Commit cb72b87c authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana Committed by Grzegorz Daniluk

Tested flash SDB read from addresses other than 0

For this to work, I also had to add (in flash.c) setting the
entry-point to the right value (the one where the SDB magic is
detected).

The rest of the commit files are just toying around for testing
purposes.
Signed-off-by: Theodor-Adrian Stana's avatarTheodor Stana <t.stana@cern.ch>
parent 4143c0f5
......@@ -223,7 +223,7 @@ int flash_sdb_check()
uint32_t magic = 0;
int i;
uint32_t entry_point[3] = {0x000000, 0x170000, 0x2e0000};
uint32_t entry_point[6] = {0x000000, 0x100, 0x200, 0x300, 0x170000, 0x2e0000};
for (i = 0; i < ARRAY_SIZE(entry_point); i++)
{
......@@ -235,6 +235,7 @@ int flash_sdb_check()
{
mprintf("Found SDB magic at address 0x%06X!\n", entry_point[i]);
wrc_sdb.drvdata = NULL;
wrc_sdb.entrypoint = entry_point[i];
wrc_sdb.read = sdb_flash_read;
wrc_sdb.write = sdb_flash_write;
flash_sdb_list(&wrc_sdb);
......
......@@ -3,7 +3,7 @@
# at offset zero at all, we want to start at zero *wihin* our space.
# This is actually the default, but stating it is better.
.
position = 0x170000
position = 0x100
# Then, we have a number of writable files. By default (i.e. no config)
# all existing files are created as read-only files with current contents
......
......@@ -236,6 +236,7 @@ int main(void)
{
uint8_t rdat[256];
int i;
uint32_t addr;
check_reset();
wrc_ui_mode = UI_SHELL_MODE;
......@@ -251,18 +252,22 @@ int main(void)
w();
mprintf("flash init\n");
uint8_t d[4] = { 0xaa, 0xbb, 0xcc, 0xdd};
flash_init();
flash_read(0x170000,rdat,256);
for (i = 0; i < 256; i++)
printf("0x%02X ", rdat[i]);
printf("\n");
flash_read(0x170100,rdat,256);
for (i = 0; i < 256; i++)
printf("0x%02X ", rdat[i]);
printf("\n");
// flash_sdb_check();
//#define ADDRSTART 0x100
//#define ADDRMAX 0x600
// addr = 0x100;
// mprintf("reading from 0x%06X to 0x%06X\n", addr, ADDRMAX);
// for (addr = ADDRSTART; addr < ADDRMAX; addr += 256)
// {
// flash_read(addr,rdat,256);
// for (i = 0; i < 256; i++)
// printf("0x%02X ", rdat[i]);
// printf("\n");
// }
// mprintf("done; current address 0x%06X\n", addr);
flash_sdb_check();
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment