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() ...@@ -223,7 +223,7 @@ int flash_sdb_check()
uint32_t magic = 0; uint32_t magic = 0;
int i; 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++) for (i = 0; i < ARRAY_SIZE(entry_point); i++)
{ {
...@@ -235,6 +235,7 @@ int flash_sdb_check() ...@@ -235,6 +235,7 @@ int flash_sdb_check()
{ {
mprintf("Found SDB magic at address 0x%06X!\n", entry_point[i]); mprintf("Found SDB magic at address 0x%06X!\n", entry_point[i]);
wrc_sdb.drvdata = NULL; wrc_sdb.drvdata = NULL;
wrc_sdb.entrypoint = entry_point[i];
wrc_sdb.read = sdb_flash_read; wrc_sdb.read = sdb_flash_read;
wrc_sdb.write = sdb_flash_write; wrc_sdb.write = sdb_flash_write;
flash_sdb_list(&wrc_sdb); flash_sdb_list(&wrc_sdb);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# at offset zero at all, we want to start at zero *wihin* our space. # at offset zero at all, we want to start at zero *wihin* our space.
# This is actually the default, but stating it is better. # 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) # 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 # all existing files are created as read-only files with current contents
......
...@@ -236,6 +236,7 @@ int main(void) ...@@ -236,6 +236,7 @@ int main(void)
{ {
uint8_t rdat[256]; uint8_t rdat[256];
int i; int i;
uint32_t addr;
check_reset(); check_reset();
wrc_ui_mode = UI_SHELL_MODE; wrc_ui_mode = UI_SHELL_MODE;
...@@ -251,18 +252,22 @@ int main(void) ...@@ -251,18 +252,22 @@ int main(void)
w(); w();
mprintf("flash init\n"); mprintf("flash init\n");
uint8_t d[4] = { 0xaa, 0xbb, 0xcc, 0xdd};
flash_init(); flash_init();
flash_read(0x170000,rdat,256);
for (i = 0; i < 256; i++) //#define ADDRSTART 0x100
printf("0x%02X ", rdat[i]); //#define ADDRMAX 0x600
printf("\n"); // addr = 0x100;
flash_read(0x170100,rdat,256); // mprintf("reading from 0x%06X to 0x%06X\n", addr, ADDRMAX);
for (i = 0; i < 256; i++) // for (addr = ADDRSTART; addr < ADDRMAX; addr += 256)
printf("0x%02X ", rdat[i]); // {
printf("\n"); // flash_read(addr,rdat,256);
// for (i = 0; i < 256; i++)
// flash_sdb_check(); // printf("0x%02X ", rdat[i]);
// printf("\n");
// }
// mprintf("done; current address 0x%06X\n", addr);
flash_sdb_check();
return 0; 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