danak6jq / Seeed-LoRa-E5

LoRaWAN end node built from scratch using CubeMX for WLE5x in the LoRa-E5
Other
46 stars 10 forks source link

Using USART1 for IrDA #17

Closed pablo-1424 closed 1 year ago

pablo-1424 commented 1 year ago

Hello,

I want to change the USART1 to IrDA mode. To do that I have change the Platform settings of the LoRaWAN to USART2 and that is all good. But when I generate the code and compile, it gives me an error in the usart_if.c file :

C:/work/Seeed-LoRa-E5/Debug/../Core/Src/usart_if.c:217: undefined reference to `hdma_usart2_tx'

Do you have any idea to resolve this issue ?

Thanks for your code, that is my only problem,

Pablo

danak6jq commented 1 year ago

@pablo-1424 what changes exactly did you make to USART2? Did you add DMA support?

danak6jq commented 1 year ago

This is doubtlessly an issue with CubeMX code generation. It looks like USART2 is configured to use DMA for TX, but the DMA service function is not present. This makes me think that, after configuring USART2 and generating code from the IOC, some source file(s) was over-written with an older version (or mis-merged). In particular I'd look at Core/Src/usart.c - this is where CubeMX generates the DMA handler.

This isn't an issue in the LoRaWAN project, it's a hiccup in source changes in your workspace. After running CubeMX and generating source, you should have hdma_usart2_tx in usart.c - is this not the case?