Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2024, 05:26:20 17:26


Login with username, password and session length


Pages: [1]
Print
Author Topic: porting code from gcc to keil mdk arm  (Read 9671 times)
0 Members and 1 Guest are viewing this topic.
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« on: October 18, 2014, 01:15:03 01:15 »

im trying to port codes from coocox/gcc to keil, I could not get away without having more than 50 warnings and a couple of errors. im seeking the help of people experienced in both worlds to show me how I can port coocox projects to keil. demo_48_usb_hid.zip is the original project, while usb-keil.zip is the project I created in keil.

Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #1 on: October 18, 2014, 08:15:09 08:15 »

Hi Metal,

I may try to look into it, but first think that comes to my mind - why dont just use usb hid sample code on keil package?

-ichan
Logged

There is Gray, not only Black or White.
DarthPic
V.I.P
Junior Member
*****
Offline Offline

Posts: 70

Thank You
-Given: 715
-Receive: 67



« Reply #2 on: October 18, 2014, 10:52:12 10:52 »

Hi ,
I see you use the UB library  Wink , i have get allot of problem for convert the Coocox 'model' to Keil , Cx must probably consider variable as global because in some
case i just add 'extern' in front of some declaration in the '*.h' and then redeclare the variable into the corresponding '*.c' file and it's OK ...
But ! , recently i found the 'TM' library  Lips sealed
it's like the UB in the difference that is yet for my cheer Keil  Cheesy
Info on the GitHub and main page link in the txt.

Cheers.
Logged

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why Wink ...
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #3 on: October 18, 2014, 02:34:46 14:34 »

most HID examples show mouse, gamepad, joystick or keyboard. What I was looking for was a custom HID that sends/receives 64bytes and that's it.

It seems that gcc and keil are very incompatible, sth like xc8 and mE. I knew both, so I was able to port either directions, now im new to arm and fu cked up Cheesy
Logged
DarthPic
V.I.P
Junior Member
*****
Offline Offline

Posts: 70

Thank You
-Given: 715
-Receive: 67



« Reply #4 on: October 18, 2014, 06:44:34 18:44 »

Well , if you just need to send/receive 64 bytes then build your project on the :
24-STM32F429_USB_VCP example.
It create a virtual com port that you can communicate with you PC.
Now for more info , you can ask on the TM page (where you get the lib) or ask 'Clive' on the ST Forum.

Cheers.


Logged

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why Wink ...
flo0319
Junior Member
**
Offline Offline

Posts: 81

Thank You
-Given: 7
-Receive: 17


« Reply #5 on: October 20, 2014, 08:27:26 20:27 »

I hope that this will help you:
1) You have warnings because you are using assert_param() without definition. If you don't need it you can define an empty macro : #define assert_param(expr). Or if you need it, include stm32f4xx_conf.h and define USE_FULL_ASSERT 1
2) For USB have a look in STM32Cube\STM32CubeMX\STM32Cube_FW_F4_V1.3.0\Middlewares\ST\STM32_USB_Device_Library\Class\CustomHID. Custom HID is using 2 end points IN and OUT and has a different descriptor then mouse or keyboard.
Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #6 on: October 21, 2014, 12:21:36 00:21 »

Hi,

Actually I did import it to keil, I did not have time to work on it for the last couple of days. Tonight I just figured how to do it, which files to use from the pack that get added by keil, and which to add from the original project. It works a treat, I had to comment one line, add (uint8_t *) to another line and use extern for USB_HID_STATUS (DarthPic, I remembered you).

What made me sit on my ass and do it is that I contacted Tilen Majerle, but seems he is not willing to change the current library which is for mouse/gamepad/keyboard stuff that no body uses, he recommended his VCP library. I can’t see anything wrong with custom HID communication for a simple IN/OUT EP, I wish I could do the changes myself and use TM usb library, indeed. There are tons of codes to show mouse/gamepad/keyboard which no body needs, most people are keen for sth simpler and a small piece of software to show data sent and received.
 
Using VCP means that I will have to create my PC delphi software using comport rather than HID component, in addition to that I will have to install ST driver so that PC recognizes the new virtual comport created by the discovery, I hate this to be honest, although I tested VCP example yesterday just for fun.

code and test software attached. Use write button in the software, the discovery should echo what you send from the software.
« Last Edit: October 21, 2014, 12:24:39 00:24 by metal » Logged
Ichan
Hero Member
*****
Offline Offline

Posts: 833

Thank You
-Given: 312
-Receive: 392



WWW
« Reply #7 on: October 21, 2014, 03:45:34 15:45 »

I did try to porting it for a while, but stopped when it can not be linking successfully.

Now i am interested for a complete guidance on porting GCC to Keil MDK ARM, many good projects are in GCC. One that i am very keen to have it in keil environment is MicroPython.

Many Gurus in here who can teach us, i believe.

-ichan
Logged

There is Gray, not only Black or White.
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2420

Thank You
-Given: 862
-Receive: 678


Top Topic Starter


« Reply #8 on: October 21, 2014, 04:39:44 16:39 »

I will try to make a video for my part, give me some time, I have been very busy recently, it will be a long video though.. may be other professionals can do other videos as well.
« Last Edit: October 21, 2014, 04:47:54 16:47 by metal » Logged
snoop911
Junior Member
**
Offline Offline

Posts: 45

Thank You
-Given: 28
-Receive: 13


« Reply #9 on: February 10, 2018, 06:09:51 06:09 »

Any success compiling a gcc project in Keil?

I see uVision5 supports gcc, but how can the project's makefile be massage by Keil's version of 'make'?
 
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC