2021-01-20 09:06 AM
Hello!
I'm using TouchGFX for a project, LCD and touch module are OK, but I have some problems with the QSPI driver (W25Q128 module).
I'm able to compile all the code and I see QSPI flash memory as used, but it gives me an error in "final launch sequence".
After including stm32746g_qspi.h (well, my board is an H743, but this file is modified by the vendor Waveshare: even if the name seems wrong, as you can see, it includes H7 headers):
//This is the stm32746g_qspi.h initial part
...
#ifndef __STM32746G_QSPI_H
#define __STM32746G_QSPI_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32H7xx_hal.h"
#include "w25q128fv.h"
...
So I put some initialization lines in MX_QUADSPI_Init() function:
void MX_QUADSPI_Init(void)
{
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 10;
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = 23;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_2_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
BSP_QSPI_Init();
BSP_QSPI_MemoryMappedMode();
HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
}
The function BSP_QSPI_MemoryMappedMode() function is not present in vendor's stm32746g_qspi.c , so I wrote this :
uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
{
QSPI_CommandTypeDef s_command;
QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
/* Configure the command for the read instruction */
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
s_command.Instruction = QUAD_INOUT_FAST_READ_CMD;
s_command.AddressMode = QSPI_ADDRESS_4_LINES;
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
s_command.DataMode = QSPI_DATA_4_LINES;
s_command.DummyCycles = W25Q128FV_DUMMY_CYCLES_READ_QUAD;
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
/* Configure the memory mapped mode */
s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
s_mem_mapped_cfg.TimeOutPeriod = 0;
if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
{
return QSPI_ERROR;
}
return QSPI_OK;
}
and, in stm32746g_qspi.h
#define BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode
Finally, I modified my linker file and after compiling (without error) I can see the ToughGFX ExtFlashSection loaded in QUAD SPI.
The problem is that the firmware isn't loaded on my board and I have this error:
Can someone help me?
Thanks and Best Regards!
2021-04-27 06:22 PM
The F7 and H7 are quite different designs internally
This is a tentative build for the F7 platform using the identified pins
https://github.com/cturvey/stm32extldr/tree/main/f7_w25q128
2021-04-28 02:13 AM
Dear @Community member !
Many thanks to reply me. I copy the stldr file, and use it. It seems to be someting is not good.
Where i search the problem?
Kind regards
Peter
2021-04-28 02:18 AM
The original Waveshare code works properly, the Chip is communicate, the Microprocessor. The test succes!
2021-04-28 04:07 PM
@Community member
Your external loader works with STM32 Cube Programmer. It is fine.
But i haven't to adapt in Cube IDE.
Which is the best setup, to debugger?
kind regards
Peter
2021-04-28 05:01 PM
I suspect it is in amongst the metadata of the settings/options. Probably in the debugger settings.
I'm primarily a Keil guy, I use GNU/GCC via makefiles
2021-05-22 12:48 PM
send to me you project
2021-05-22 12:49 PM
send to me your project
2021-07-14 05:55 AM
Hello @Peter Szucs
I'm having the same problem in my project, i can write, erase sector, read the memory W25Q128JV, but I'm trying to generate a custom loader for my project using the touchGFX for STM32H7B3VI with mappedmode, but nothing is working for now.
Could you share your example project to generate the custom loader with me?
I saw the link from github that @Community member sent you, but none of those have my pinout.
/**OCTOSPI1 GPIO Configuration
PA7 ------> OCTOSPIM_P1_IO2
PB2 ------> OCTOSPIM_P1_CLK
PD11 ------> OCTOSPIM_P1_IO0
PD12 ------> OCTOSPIM_P1_IO1
PD13 ------> OCTOSPIM_P1_IO3
PB6 ------> OCTOSPIM_P1_NCS
I don't know if my linker file have something wrong or the loader_SRC file as well, i was following the ST Video to generate this customer loader.
2021-07-14 08:33 AM
The H7Ax/Bx have OCTOSPI, and are a little different in implementation to the H74x/75x code I currently have running.
I'll probably need to port the code, adding it to my TODO list.
2021-07-14 09:50 AM
thanks for your message, but let me ask something.
when you say a little different, you mean about the all of routines to read, write, erase, mappedmode, polling??? because i have this functions working.
or about the Loader_SRC, Dev_inf files to generate the external loader properly? this i really don't know what exactly is right or no.