Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am writing a service of Contiki os, that is supposed to run on a CC2538. However, I encounter a problem that I am not aware of why happens. More specifically, I want to write to consecutive pages of flash a given array (my_arr). However, after the 20th iteration, the program stops and the board reboots. Do you know why this happens? I have also encountered a similar problem with the erase function.

int8_t* my_arr= (int8_t*)malloc(2048);

for(int i=0; i<2048; i++)
    my_arr[i] = i+1;


int8_t* init_addr = (int8_t*)0x222000;

for(int i=0;i<40;i++){

     rom_util_program_flash((uint32_t *)my_arr,
           (uint32_t)(init_addr +i*2048),
           2048);

           LOG_INFO("%d
",i);
}
question from:https://stackoverflow.com/questions/65944129/contiki-ng-cc2538-rom-util-program-flash-problem

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

The reboots are caused by the watchdog.

Try adding a watchdog_periodic() before each write to avoid the reboots.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...