cancel
Showing results for 
Search instead for 
Did you mean: 

code merging issues with HAL libraries

aatif shaikh
Associate III

Hello,

I've brought a new stm3220xG eval board for some development purpose. while going through examples code of STM32CubeMX all of them working fine individually but when I'm trying to use some parameter/functions and files into another code those newly added functions and files isn't working at all.

In my project I've added "USART3 printf" example's files and all other initialization related functions into "LWIP TCP/IP ECHO SERVER" as I need a debug port. so does anyone has any idea or knowledge about what possibly could goes wrong? either I'm missing something or improper initialization.?

Thanking with regards

Aatif shaikh

1 ACCEPTED SOLUTION

Accepted Solutions

You'll have to check list that you've copied all the right code, and then in a debugger look at the peripheral view to confirm settings are present.

Clocks

Pins

Peripheral

Clocks need to be running on synchronous designs will latch data/configuration. So order/sequencing of set up is important. HAL/CubeMX can hide things in multiple places. CubeMX tends to use a call back for peripheral initialization, GPIO clocks enabled globally, and the pins often in the call back.

Check MSP and BSP code files,

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3
AvaTar
Lead

> ... those newly added functions and files isn't working at all.

This is not a very detailed description.

Assuming the UART debug functionality doesn't work, either the init code is not correct, the clock/baudrates are not as expected, or the pins you are trying to use are already tied to other hardware.

aatif shaikh
Associate III

In STM32CubeMX examples set of "stm3220xG" both "UART (printf)" and "ETHERNET (LWIP-TCP/IP)" (note* both peripheral's examples are in different code) working properly fine as they are tested examples from ST. but when I'm copying all Init files and function from one code to another they aren't working. where as if I generate the code from STM32CubeMX itself it is working as expected.

so my question is if I'm missing any part while copying like some init part which might happen at back end in HAL libraries as I'm not very familiar with HAL library.

You'll have to check list that you've copied all the right code, and then in a debugger look at the peripheral view to confirm settings are present.

Clocks

Pins

Peripheral

Clocks need to be running on synchronous designs will latch data/configuration. So order/sequencing of set up is important. HAL/CubeMX can hide things in multiple places. CubeMX tends to use a call back for peripheral initialization, GPIO clocks enabled globally, and the pins often in the call back.

Check MSP and BSP code files,

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..