cancel
Showing results for 
Search instead for 
Did you mean: 

External Loader Debug Printing

DWeie
Associate III

Hi all,

I'm developing a custom external loader to flash a QUADSPI memory as part of a TouchGFX project. I'm using an STM32F7 processor and developing using the STM32CubeIDE.

I’m struggling with a specific issue that I’m hoping I’ll be able to get help with. Since I’m unable to observe the state of the processor while the external loader is being called from the ST-LINK Utility I’m planning on redirecting stdio to an unused USART to get run time information.

When running in debug mode in the ST32CubeIDE this is working fine, but as soon as I switch to using the .stldr (generated from the same source) through the ST-LINK Utility the functionality goes away. A rundown of what I have done on this so far is below:

I’ve proven that the Init() function is being called and is running by toggling some other GPIO and observing them.

I’ve globally disabled interrupts in Debug mode to verify that interrupts are not needed for functionality of the UART in blocking mode.

I’ve tested removing the stdio redirect from consideration by writing directly to the UART instance’s data register.

I’ve made sure to call SystemInit() before other initialization code. Normally the assembly startup calls this function, but this (along with data initialization) would be skipped when Init() is called directly by the ST-LINK application.

I have not implemented the data (.bss and zero) initialization that would normally occur in the startup code because, if I understand correctly, the ST-LINK should be doing this based on the provided .stldr file. If it is not then I am unsure where to initialize the data from since there is no reference in flash memory as there would be for normal operation.

Despite this, I am getting no print statements. I'm wondering if anyone with more experience in this might have some suggestions for me to try since I'm not able to think of a next step beyond what I've already attempted.

Thank you,

Don

25 REPLIES 25

Sorry this is a bit deep in here. Not sure, I'll take a look over the weekend.

You have a N25Q128A or MT25Qx128A device?

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

Thanks for responding. I am using the MT25QL128ABA1ESE-0SIT memory device. My controller is the STM32F746IGT6.

Ok, AF settings on two of the pins looks incorrect. Fixed that, and replaced original. Check build date in .ZIP is 3-Apr-2021

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

Unfortunately this did not work. Just to be clear I am using the MT25QL128ABA1ESE-0SIT memory with the STM32F746IGT6 controller. Device mapped as follows:

#define QSPI_CS_PIN         GPIO_PIN_6

#define QSPI_CS_GPIO_PORT     GPIOB

#define QSPI_CLK_PIN         GPIO_PIN_2

#define QSPI_CLK_GPIO_PORT     GPIOB

#define QSPI_D0_PIN         GPIO_PIN_8

#define QSPI_D0_GPIO_PORT     GPIOF

#define QSPI_D1_PIN         GPIO_PIN_9

#define QSPI_D1_GPIO_PORT     GPIOF

#define QSPI_D2_PIN         GPIO_PIN_7

#define QSPI_D2_GPIO_PORT     GPIOF

#define QSPI_D3_PIN         GPIO_PIN_6

#define QSPI_D3_GPIO_PORT     GPIOF

Specifically the error I get is a fail to erase error...

Error: failed to erase memory

Encountered Error when opening C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.6.0.202101291314\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

Can we perhaps migrate this to a new thread?

Can you try using it in a stand-alone use of STM32 Cube Programmer, with the Verbose reporting set to 3

What is the clocking strategy on this F7 board? 25 MHz HSE? XO or crystal?

Any USART available for diagnostic output? Which port/pins etc?

Any working BSP code that has Erase and Write functioning successfully? How many ms do 64KB sector and mass erase take?

My ability to test is limited to SOIC16W (300-mil 16-pin) ICs on-hand.

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

Sorry for the slow response - on vacation still trying to work this in. OK will start a new thread.