Sonsivri

Electronics => AVR, 8051 Family and ARM Area => Topic started by: metal on October 18, 2014, 01:15:03 01:15



Title: porting code from gcc to keil mdk arm
Post by: metal 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.



Title: Re: porting code from gcc to keil mdk arm
Post by: Ichan 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


Title: Re: porting code from gcc to keil mdk arm
Post by: DarthPic on October 18, 2014, 10:52:12 10:52
Hi ,
I see you use the UB library  ;) , 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  :-X
it's like the UB in the difference that is yet for my cheer Keil  :D
Info on the GitHub and main page link in the txt.

Cheers.


Title: Re: porting code from gcc to keil mdk arm
Post by: metal 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 :D


Title: Re: porting code from gcc to keil mdk arm
Post by: DarthPic 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.




Title: Re: porting code from gcc to keil mdk arm
Post by: flo0319 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.


Title: Re: porting code from gcc to keil mdk arm
Post by: metal 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.


Title: Re: porting code from gcc to keil mdk arm
Post by: Ichan 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 (http://www.micropython.org/).

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

-ichan


Title: Re: porting code from gcc to keil mdk arm
Post by: metal 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.


Title: Re: porting code from gcc to keil mdk arm
Post by: snoop911 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'?