Skip to main content
Associate II
September 11, 2025
Question

STM32F469 - DISCO. SPI2 not working when launching FreeRTOS touch gfx task

  • September 11, 2025
  • 1 reply
  • 291 views

Hi there, 

I am using and STM32F469-disco board and want it to communicate via SPI2 with a Battery Management System. When launching only the BMS task it runs perfectly, the communication is stable and I can read cell voltages and temperatures through SPI2 line. 

The thing is that when adding touch gfx task (uncommenting the initialize of the kernel) it runs the BMS task as well as Touch GFX task but the BMS task does not work correctly, it does not communicate with BMS. The same code, same task, but adding Touch GFX task creates a conflict that does not lend the SPI2 communicate with other devices. 

In theory, the pins for SPI2 (PB14 and PB15) are free of use. I also tried to disable interruptions when reading BMS in BMS task (__disable_irq()) but does not work neither.

Could someone think of a solution, or testing to know where is the problem?

Thank you very much!

PD: I would say that both Cube and Touch are updated to last version.

1 reply

Andrew Neil
Super User
September 11, 2025

What debugging have you done to see where your BMS comms are failing?

Have you looked at the SPI with an analyser to see what's happening?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
EnekkkAuthor
Associate II
September 11, 2025

I am debugging in Cube IDE and looking into live variables. 

Next step is looking with an oscilloscope and protocool analyzer the SPI clock,SS signal and the data itself...

 

Andrew Neil
Super User
September 11, 2025

Try also instrumenting the code; eg, add UART output logs to give real-time visibility of what's going on.

Compare & contrast the working & non-working case.

 

PS:

When it is working, is the BMS task still under FreeRTOS?

Does the Touch GFX task work?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.