by critor » 21 Jan 2018, 00:09
Ok, I've removed the Boot2, because I don't need it for my tests :
- made your script assume the Boot2 size is 0
- commented the boot2 image concatenation
Commented everything in the ControlX main.
Added at the start of the main :
- Code: Select all
asm("ldr r1,=0x00000C12");
asm("mrc p15,0,r0,c2,c0,0");
asm("str r1,[r0,#4]");
asm("ldr r0,=0x00000000");
asm("mcr p15,0,r0,c8,c7,1");
And at the end of the main :
- Code: Select all
while(1);
Seems to work in firebird. By triggering the debugger and typing
d 0
the Boot1 seems to be there.

Uncommented 2 screen output lines :
- Code: Select all
asm("ldr r1,=0x00000C12");
asm("mrc p15,0,r0,c2,c0,0");
asm("str r1,[r0,#4]");
asm("ldr r0,=0x00000000");
asm("mcr p15,0,r0,c8,c7,1");
/* ... */
init_screen();
clearLines(SCREEN_BASE_ADDR,0,SCREEN_HEIGHT-1);
/* ... */
while(1);
Perfect, the screen turns black.

Just uncommented other init lines at the start of the main, no Flash I/O for the moment...
- Code: Select all
asm("ldr r1,=0x00000C12");
asm("mrc p15,0,r0,c2,c0,0");
asm("str r1,[r0,#4]");
asm("ldr r0,=0x00000000");
asm("mcr p15,0,r0,c8,c7,1");
int i,j;
uint8_t uninstalled=0;
ut_disable_watchdog();
menu=(is_key_pressed(KEY_CTRL)) || (is_key_pressed(KEY_ESC) && is_key_pressed(KEY_MENU) && is_key_pressed(KEY_MINUS));
if(is_key_pressed(KEY_DOC) && is_key_pressed(KEY_ENTER) && is_key_pressed(KEY_EE))
maintenance=1;
startstatus=1;
memset(status,' ',STATUS_SIZE);
status[STATUS_SIZE]=0;
asicflags = ((*(volatile unsigned int*) 0x900A002C)>>26)&0b11111;
init_screen();
clearLines(SCREEN_BASE_ADDR,0,SCREEN_HEIGHT-1);
/* ... */
while(1);
... and suddenly it won't work any more.

Firebird complains about :
Error (00000000): Cannot modify currently executing code block.