This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART STM32F401 EvBoard with VL6180X

Hi,
I'm trying everything to get this project to work, but can't. I have tried moving library files and having tons of problems with Keil's linker, but I somehow (idk how atm) managed to compile everything smoothly. I'm trying to use the UART module of the STM32F401RET board to calibrate the limiting distance the sensor should set the alarm on. The sensor is working just fine with the example ST provided. I used the STM32CubeMX to make a UART example code for initialization, and followed a tutorial to make it work (it worked by itself) the thing is that when I try to merge them together (the sensor's code and the UART example) the UART transmision timeouts, and never sends anything through the UART module.

Anyone has any advice about this?
I really need your help!
Thank you for your time, Alan.

Parents
  • The standard rule when merging code from different sources is to make sure you know how the code works.

    If the sensor code locks up while waiting for something, then that will affect other code that assumes some state variable or hardware should be regularly polled.

    Sometimes a solution might be to use an RTOS so you run the two functionalities in different threads to make sure the OS gives time slices to both functionalities as needed. But that still requires you - the developer - to understand the code good enough to be able to make use of the primitives available in the RTOS in regards to waiting for events etc.

Reply
  • The standard rule when merging code from different sources is to make sure you know how the code works.

    If the sensor code locks up while waiting for something, then that will affect other code that assumes some state variable or hardware should be regularly polled.

    Sometimes a solution might be to use an RTOS so you run the two functionalities in different threads to make sure the OS gives time slices to both functionalities as needed. But that still requires you - the developer - to understand the code good enough to be able to make use of the primitives available in the RTOS in regards to waiting for events etc.

Children
No data