Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32 porting #122

Open
EasyNetDev opened this issue Jan 26, 2021 · 4 comments
Open

STM32 porting #122

EasyNetDev opened this issue Jan 26, 2021 · 4 comments

Comments

@EasyNetDev
Copy link

EasyNetDev commented Jan 26, 2021

Hi,

I started to do some test with my Nucleo-144 F767ZI board using STM32 MCU. I want to try to port the CS-EX to STM32.
I was able to replicate the old DCC++ PWM overflow IRQ to change the frequency for the PWM output on my STM32 board.
Now I took the code from CS-EX and I'm very confused. The code is very different from DCC++ :).
I found some spots where I have to add my STM32 code, like Timer.h which I have to write it for STM32, but also I've notice some other parts in the code.
There is a documentation for developers where I can find these information?

My idea to port on STM32 is because F767ZI is using a 216MHz MCU with much more EEPROM, RAM and FLASH.
Also other STM32 boards are using 72Mhz MCU and also they are more powerful than Arduino. Also the pinout is compatible with Arduino.

Other advantages:

  • Nucleo F767ZI (and also other STM32 boards) have integrated ethernet + CAN bus protocol (it needs only the CAN transceiver).
  • STM32 is using 32 bit registers instead 8bit from Arduino, which make it much faster in calculations.
  • plenty of outputs comparing with Arduino.
  • Maybe in the future I can add LCC protocol integration in the board to be able to have only one board to manage both DCC and LCC through the ethernet connection.

I would appreciate any help to start the porting.

@Asbelos
Copy link
Contributor

Asbelos commented Jan 26, 2021

The code is very different ss you have discovered... however there is already an experimental branch where we have had to isolate stuff like timers into code that can be compiled on different platforms.

I suggest you downliad the nanoEvery2 branch from this repository and search the code for the few places where we check the ARDUINO_ARCH_ definitions and it should become much clearer.

@EasyNetDev
Copy link
Author

Hi Asbelos,

Thank you for your answer! I will take a look to that repository.
If you managed to isolate this kind of stuff, it will be much easier for others to read the code. :)

I will give a try to that repository.

@Asbelos
Copy link
Contributor

Asbelos commented Jan 27, 2021

For a general discussion on porting find me as UKBloke on our Discord chat

@Asbelos
Copy link
Contributor

Asbelos commented Feb 1, 2021

Just to keep you informed, the nanoEvery2 branch has been updated to use even less device specific code or files.
If you have to do any more changes, please keep us informed and we will do our best to keep the code portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants