JesseGuoX / CANopenSTM32-HAL

CANopenNode running on STM32 using HAL library
1 stars 1 forks source link

Trying to configure this repo to work on stm32F103R8Tx #1

Closed woudie closed 3 years ago

woudie commented 3 years ago

Hi All,

I noticed this repo the other day and it seemed like the easiest to follow the implementation of CANopen on an stm32 I have found so far. I am very new to stm32 development (embedded in general really) and CANOpen itself, so trying to implement CANOpenNode on my stm32f103R8 has not been successful (yet). I tried to configure an empty project using stm32cubeide for my device and tried to transplant the difference between my empty project and your repo and most of the HAL library was fine already because we both use STM31F1 series devices. At the moment I am facing issues with CO_storage.c, where PC0, PC1, PC13, and PC14 are being used. Since I do not have them initialized, it errors out there. What are you using this GPIO for? Any help or assistance on this matter or configuring canopen for an stm32f103 is greatly welcomed and appreciated! Sorry if these are very novice questions, at the moment, I am a novice, hahaha.

Cheers, woudie

JesseGuoX commented 3 years ago

Hi @woudie , you can read README first, electronic schema is Assets/schema.pdf. PC0、PC1、PC14、PC15 for LEDS,PC2 for button. It's easy to change processor from stm32f105rbt6 to stm32f103R8 in STM32CubeIDE.

woudie commented 3 years ago

Hi @Jexbat ,

Ahh yes, I see, sorry about that, should have checked the readme first before messing around with it ahaha. If you don't mind me asking, how would you change the processor, I tried to look it up, but it seems like building a new project and copying over relevant files is the best option. I did that and moved over what seemed like the relevant files and things seem to be sort of working right now. Do you know how I could set the heartbeat to send periodically? I'm going to try to mess around with it more to better understand how to configure tpdo's and sdo's.

On a side note, could you explain what peripherals CANOpenNode makes use of on the stm32 boards? I was trying to use this on a custom pcb that had can functionality (which worked fine on its own), but had no luck as it would keep erroring out. Luckily I had a dev board lying around and tried with that and sent a sdo and got a response to know I was on some sort of right track. Again, apologies for the novice questions, haha.

JesseGuoX commented 3 years ago

Hi @woudie , you could learn how to use STM32CubeIDE first, like how to create a new project and import thirdpart library, it's just some Library setting and PATH setting things. And for stm32 program, what peripherals CANOpenNode makes use of is depened on which kind product you want to build, LEDS and Button in my project are just for functionnal test.

woudie commented 3 years ago

Hey @Jexbat,

Thanks for the advice! Yeah, I've since messed around a bit more and started to get the hang of getting CANOpen node running and running some basic sdo cmds, trying to figure out how to remap pdos and what not right now, haha. Thanks for the help & advice!