cancel
Showing results for 
Search instead for 
Did you mean: 

Migrating an existing ST example AN4457 for Emulated UART from STM32F401 -> STM32F746

LTD-Dave
Associate

I am working on an existing embedded firmware application on an STM32F746ZG that requires we add one more (9 total) UART.  

There is an existing ST application note AN4457 based on the STM32F401RE that looks to be a perfect match for my requirements.  

https://www.st.com/en/embedded-software/stsw-stm32156.html

I have been able to load up this application in STM32CubeIDE and get it running on the 401RE nucleo board. So far so good...

I am a bit lost on how to migrate this application from the F4 series to the F746 nucleo. Is there an on-line resource that might guide me through the steps.

I have tried many searches but my google-foo must not be up to the task.

I have tried to make an empty F7 series project in the cubeIDE and port the code manually but after hours of working on getting the hal drivers to compile I can not get the correct project dependencies in place to be able to compile.

Also does anyone have any concerns that the application note approach is possible with the F746. The principle consists in emulating the UART protocol via GPIO, EXTI, timer and DMA peripherals. At this point my understanding is there is enough family resemblance that this approach is possible.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Danish1
Lead II

I recently did something very similar from stm32f405 to stm32f767 (reception only, 9600 baud) and it worked without significant effort.

Things to watch out for:

  1. DMA can only go to/from memory areas that aren't cached - or you need to manage the cacheing yourself. On 'f767 I have an area of SRAM where I have configured the MPU not to buffer / cache. I ensure that the DMA goes to/from there, and that works for me. But I recently read that you can also use DTCM for this without having to worry about cache coherency.
  2. The interconnectedness of timers, DMA channels, clock sources and the like might be very different, so double-check all the choices with the Reference Manuals.
  3. You do need to change the libraries from e.g. stm34f4xx_hal_dma.c to stm32f7xx_hal_dma.c (and hal_tim.c)
  4. Edit stm32f7xx_hal_conf.h to enable the right modules.
  5. Your clock speed might also be different. Check the baud rates!

I don't use STM32CubeIDE. (When I started it didn't exist. I tried a few IDEs and chose Rowley Crossworks.)

Hope this helps,

Danish

View solution in original post

2 REPLIES 2
Danish1
Lead II

I recently did something very similar from stm32f405 to stm32f767 (reception only, 9600 baud) and it worked without significant effort.

Things to watch out for:

  1. DMA can only go to/from memory areas that aren't cached - or you need to manage the cacheing yourself. On 'f767 I have an area of SRAM where I have configured the MPU not to buffer / cache. I ensure that the DMA goes to/from there, and that works for me. But I recently read that you can also use DTCM for this without having to worry about cache coherency.
  2. The interconnectedness of timers, DMA channels, clock sources and the like might be very different, so double-check all the choices with the Reference Manuals.
  3. You do need to change the libraries from e.g. stm34f4xx_hal_dma.c to stm32f7xx_hal_dma.c (and hal_tim.c)
  4. Edit stm32f7xx_hal_conf.h to enable the right modules.
  5. Your clock speed might also be different. Check the baud rates!

I don't use STM32CubeIDE. (When I started it didn't exist. I tried a few IDEs and chose Rowley Crossworks.)

Hope this helps,

Danish

First, Danish please accept my thanks for taking the time to answer my questions.

I have be able to get it functional with reception at 9600 and will now work on the transmit side of the communication link.

Thanks again.

Dave