Associate
December 6, 2020
Solved
TuchGFX - STM32F412G-DISCO Scrollist items get from qspi flash
- December 6, 2020
- 1 reply
- 1558 views
Hello everyone. I just met Touch Gfx and I am a student.
I want to display a list I saved in the first sector of qspi flash in the scrollist
but I could not reach a kind of result
I kept the first 2mb of the flash to myself
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
QSPI (r) : ORIGIN = 0x90200000, LENGTH = 14M
}// ***** readTable.h ****
class readTable
{
public:
void kategorisayisi (); // reading and extracting data from flash
char * RitimIsmiGonder(int no); //for ScrollRitimUpdateItem call
private:
char * ritimListesi[121]; // The array I want to send to the scrollist widget
}
};I do reading, extracting and sending in a class called readTable.
// readTable.cpp
uint16_t sizem = 1000;
volatile char *externalFlash =( char * ) 0x90000000;
char data[1000];
char delim[] = "\r\n";
void readTable::kategorisayisi()
{
for(uint16_t i = 0; i < sizem; i++)
{
data[i] = externalFlash[i]; //dump form extFlash
}
char *ptr = strtok(data, delim); // sorting process
for(int i=0;i<121;i++)
{
ritimListesi[i]=ptr; // transfer fragmented data to array
ptr = strtok(NULL, delim);
}
}
char * readTable::RitimIsmiGonder(int no)
{
return ritimListesi[no]; //Array element returning for ScrollRitimUpdateItem call
}// **** scrollist CustomContainer *****
#include <gui/containers/RitimIsimleriLCont.hpp>
#include "readTable.hpp"
RitimIsimleriLCont::RitimIsimleriLCont()
{
}
readTable rt;
void RitimIsimleriLCont::initialize()
{
RitimIsimleriLContBase::initialize();
}
void RitimIsimleriLCont::setNumber(uint8_t no)
{
Unicode::strncpy(RitimlerBuffer ,( const char *)t.RitimIsmiGonder(no) ,10 ); // Calling my list array element
}After all, I can't see anything in the scrollist (sometimes '?' Characters are seen)
I can follow it to a point while debugging the program.
but after a while I lose all values.
Where am I making a mistake? An eye to see from the outside will help me a lot.
Thank you in advance...
