cancel
Showing results for 
Search instead for 
Did you mean: 

Custom board issue with STSPIN32G4

jimmydvr
Associate II

Hi.

I am currently working on a custom board using the stspin32g4. This was derived from the evspin32g4 development board alone with the stm32 motor workbench. Uploading the motor workbench code to the evspin32g4, works and can tune the motor parameters through serial.

Moving away from the development evspin32g4 to a custom board has become a tad tricky. I am able to possible flash the custom board's stspin32g4 microcontroller using the ST-link/V2 programmer/ debug tool. However, I couldn't get the serial uart port working. I can confirm the source code is exactly the same (Being uploaded) to the evspin32g4 (So I don't think it's a programming issue).

At first, I tried confirming the UART is working correctly. I used the SFR in the stm32 IDE debug tab and modified the registers (When it is in debug mode) (Register USART1 --> RDR (Checking byte sent from the computer serial port application matches the hex value present) and (Register USART1 --> TDR (Writing a hex value and confirming the serial port receives the byte set). - So, I know the serial port is wired correctly and the stspin32g4 is working receiving and transmitting data.

What I notice is, when the custom board is in debug mode, it seems to run slower compared to the evspin32g4 board (Possible different programmer used?)

Another strange thing happens when Step over the debug code in the MX_NVIC_Init() function and onto line HAL_NVIC_EnableIRQ(TIM1_BRK_TIM15_IRQn). It causes the code to lockup at address 0x1fff4b30.

However, if I Step-into code, it gets to the while(1) source code (Reside at address 0x80011ee).

jimmydvr_0-1744798321525.png

I then preceded to check each MCU pin (Scope the pins) and found some differences. However, when I check what the pins are, they are not assigned in the MCU stm32 IOC configuration tool (PA2 / PA3 / PA6 / PA7 / PC4 / PC5 PA8 / PA12 / PB4 / PB5 PB6)

I have checked the power supplies; VM pin, and it is a stable 24V supply (Power in). The VCC and REGIN pins (~8/9V) and the VDD is stable 3.3V output. The power supply is supplied with the same to the evspin32g4 development board, so I don't think it's a supply problem.

I think the processor's clock is running or else the USART1 wouldn't have worked or decoded the byte values correctly (Default: 170MHz).

I kind of hit a stumbling block and any assistance in regard to where to look or a method diagnosing the custom board would be greatly appreciated. 

 

1 REPLY 1
GMA
ST Employee

Hello @jimmydvr,

When TIM1_BRK_TIM15_IRQn interrupt is trigged, associated TIM1_BRK_TIM15_IRQHandler function is called. It seems that the address is not correct (does fw have been successfully compiled?). Check how the TIM1_BRK_TIM15_IRQHandler firmware is handled.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA