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

Add support for STM32 #31

Open
sixstringsg opened this issue Apr 26, 2021 · 14 comments
Open

Add support for STM32 #31

sixstringsg opened this issue Apr 26, 2021 · 14 comments

Comments

@sixstringsg
Copy link

How possible would it be to add support for the STM32 Arduino core? Right now there's a whole pile of compile errors similar to 'UCSRnB' was not declared in this scope

@peternewman
Copy link
Contributor

@midikidi has apparently done it already, see some of the discussion in #29 .

I suspect it could be fixed with https://www.deviceplus.com/arduino/arduino-preprocessor-directives-tutorial/ or similar.

Have you tried setting this:

// The library works unchanged with the Arduino 2009, UNO and Arduino MGEA 2560 boards,
// using the serial port 0 and the Arduino Leonardo using serial port 1 (on the 32u4 boards the first USART is USART1)
// For using the serial port 1 on a Arduino MEGA 2560 board, enable the DMX_USE_PORT1 definition.
// #define DMX_USE_PORT1

Which might declare that value.

@midikidi
Copy link

Hi Sixstringsg, As Peter said I have ported it to the STM32 but It is built with the STM32 Cube IDE. I guess it would be fairly straight forward to port to the Arduino IDE. IF Arduino knows about STM Uart registers and supports HAL functions. I have implemented 12 timers to give me hi resolution PWM all RDM is working I am working on 6 personalities almost there I can select them but cant get my the personality description working.

@IS512
Copy link

IS512 commented Apr 26, 2021

ESP32 Arduino Core support too would be handy ;)

@midikidi
Copy link

Done a lot of work with DMX and had a lot of issues with ESP32 loosing DXM data the ESP8266 is better. I think the ESP32 with all its background tasks /2 core and the Uart itself is a place to start. Even Claudeheintz a wiz with DMX says the same. Sparkfun has code for there ESP32 shield and that looses data in the higher DMX addresses. Sparkfun doesn't do any thing fancy to detect break but the claudeheintz library does.

@IS512
Copy link

IS512 commented Apr 26, 2021

ESP32 can do high-frequency 16bit PWM, Yeah Claudes library has some issues to sort out.

This library has been great so far but obviously lacks the complexity of RDM:
https://github.com/luksal/ESP32-DMX-RX

@sixstringsg
Copy link
Author

sixstringsg commented Apr 26, 2021

@midikidi would you mind sharing your copy of the library with STM32 support? Or is the zip you posted in your issue the latest? I would love to try and get it to work in the Arduino IDE, The STM32 Arduino Core appears to support HAL & UART, but if not I can figure out the Cube IDE if I have to.

@midikidi
Copy link

Happy to forward the dmx part as there's bits I cant share, but it should help. if you manage to get personalites working it would help me. Im a novice with github so no sure how to send zip

@midikidi
Copy link

ok sussed it
temp.zip

@peternewman
Copy link
Contributor

@midikidi my comments in #29 (comment) still stand. If you put that code in a repo somewhere (ideally a fork of this repo) I'm happy to review and comment on the personality stuff and can probably point you in the right direction to get it working.

@sixstringsg
Copy link
Author

@midikidi would you mind if I uploaded your changes to a repository like @peternewman is asking? I'm happy to assist as I know you're new to GitHub, I just don't want to use your changes without permission.

@midikidi
Copy link

Sixstringsg feel free to use the code as you like its for anyone Appreciate you asking Im up against a deadline on a project and no time to get to grips with github busy coding (LEDSynth) c++/c/html/js/css/arduino and stm cube .Peter any help with Sixstrinsg's efforts greatly appreciated

@arielreyes2021
Copy link

Hello, I wanted to know if it was possible to get a dmx library for stm32... I have a board with a stm32f407ve and I would need a dmx library...

@riwalker
Copy link

riwalker commented Feb 9, 2023

Will this code run on any STM32 Micro ?
any specific requirements ? i.e 2 UART, >32K Flash etc ?
and will this be ported if ifdef comments to the standard DMXSERIAL library ?

@madfishy
Copy link

Hello There,
Did support for STM32 ever get added to DmxSerial2? or does someone have an Arduino sketch with @midikidi running that they could share.

Thanks in advance
Regards
E

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

7 participants