Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 10:37:29 10:37


Login with username, password and session length


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

Posts: 2018

Thank You
-Given: 514
-Receive: 477


Top Topic Starter


« on: October 18, 2014, 02:15:03 02: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

nothing to say..
Ichan
Hero Member
*****
Offline Offline

Posts: 840

Thank You
-Given: 312
-Receive: 387



WWW
« Reply #1 on: October 18, 2014, 09:15:09 09: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
Junior Member
**
Offline Offline

Posts: 54

Thank You
-Given: 453
-Receive: 55



« Reply #2 on: October 18, 2014, 11:52:12 11: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: 2018

Thank You
-Given: 514
-Receive: 477


Top Topic Starter


« Reply #3 on: October 18, 2014, 03:34:46 15: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

nothing to say..
DarthPic
Junior Member
**
Offline Offline

Posts: 54

Thank You
-Given: 453
-Receive: 55



« Reply #4 on: October 18, 2014, 07:44:34 19: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: 82

Thank You
-Given: 7
-Receive: 16


« Reply #5 on: October 20, 2014, 09:27:26 21: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: 2018

Thank You
-Given: 514
-Receive: 477


Top Topic Starter


« Reply #6 on: October 21, 2014, 01:21:36 01: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, 01:24:39 01:24 by metal » Logged

nothing to say..
Ichan
Hero Member
*****
Offline Offline

Posts: 840

Thank You
-Given: 312
-Receive: 387



WWW
« Reply #7 on: October 21, 2014, 04:45:34 16: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: 2018

Thank You
-Given: 514
-Receive: 477


Top Topic Starter


« Reply #8 on: October 21, 2014, 05:39:44 17: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, 05:47:54 17:47 by metal » Logged

nothing to say..
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