The only differences I can see so far in the compiled code between 9 & 10 for boot.c are:- function boot() has push {r4, lr} at the start and pop {r4, lr} just before the jump to h_usrInit- function boot() calls FW memcpy and memset to initialise the data and bss RAM
Perhaps the FW function for memcpy is wrong, although it is used in other places in CHDK and if it was wrong would likely cause other issues.
boot() on a540 is entirely inline asm, so it doesn't use memcpy/memset. boot() on ixus700 and ixus70 is a mix of C and asm. So that maybe points to memset/memcpy but I don't see exactly how.
Out of curiosity, what happens if you use memcpy on the A540 in the boot() function?
I tried putting blinking code after each copy, and it hung blinking with gcc 9 (edit: or maybe my code was buggy)
static void x_blink(int cnt){ volatile long *p=(void*)LED_PR; int i; for(;cnt>0;cnt--){ p[0]=0x46; for(i=0;i<0x200000;i++){ asm ("nop\n"); asm ("nop\n"); } p[0]=0x44; for(i=0;i<0x200000;i++){ asm ("nop\n"); asm ("nop\n"); } }}... asm volatile ( "MRC p15, 0, R0,c1,c0\n" "ORR R0, R0, #0x1000\n" "ORR R0, R0, #4\n" "ORR R0, R0, #1\n" "MCR p15, 0, R0,c1,c0\n" :::"r0"); x_blink(5); for(i=0;i<canon_data_len/4;i++) canon_data_dst[i]=canon_data_src[i]; x_blink(5); for(i=0;i<canon_bss_len/4;i++) canon_bss_start[i]=0; x_blink(5); asm volatile ( "MRC p15, 0, R0,c1,c0\n" "ORR R0, R0, #0x1000\n" "BIC R0, R0, #4\n" "ORR R0, R0, #1\n" "MCR p15, 0, R0,c1,c0\n" :::"r0"); x_blink(5);
Started by jeff666 Firmware Dumping
Started by genosmm General Help and Assistance on using CHDK stable releases
Started by reyalp General Discussion and Assistance
Started by cppasm « 1 2 » General Discussion and Assistance
Started by ahmed380 Feature Requests