logo elektroda
logo elektroda
X
logo elektroda

[Solved] [esp-idf] i2c core panic. Load prohibited. Exception was unhandled

NIXIE_123 831 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Possible buffer overrun in DS3231 I2C read/write code

    #1 19468202
    NIXIE_123
    Level 34  
    Posts: 2087
    Help: 288
    Rate: 609
    Hi

    I am reading the time every second from ds3231 over i2c.
    I have added a time setting which increments or decrements the time read every second with each key click and plays it to the ds3231 over i2c.
    Setting hours and minutes works. Setting seconds also works but very often the processor panics:
    [esp-idf] i2c core panic. Load prohibited. Exception was unhandled .

    Reading out the time every second in a shuffle with stack size=2048:
    Code: C / C++
    Log in, to see the code
    .

    Setting time (recall hours and minutes work) in main:
    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • Helpful post
    #2 19468891
    mpier
    Level 29  
    Posts: 818
    Help: 153
    Rate: 141
    Hello,
    I haven't used esp-idf, are you sure you can operate on "cmd" after calling "i2c_cmd_link_delete(cmd)"?
    The whole time setting thing isn't kind of weird in this code? Maybe it would be easier to get the current time (not necessarily via i2c), modify it arbitrarily and send it to the external rtc at the end? Is this esp so unstable that you have to check the time every second?
  • ADVERTISEMENT
  • Missing i2c_config_t field initialization causing panic

    #3 19468901
    NIXIE_123
    Level 34  
    Posts: 2087
    Help: 288
    Rate: 609
    Code: C / C++
    Log in, to see the code
    .

    Quote:
    This CPU exception happens when application attempts to read from or write to an invalid memory location. The address which was written/read is found in EXCVADDR register in the register dump. If this address is zero, it usually means that application attempted to dereference a NULL pointer. If this address is close to zero, it usually means that application attempted to access member of a structure, but the pointer to the structure was NULL. If this address is something else (garbage value, not in 0x3fxxxxxx - 0x6xxxxxxx range), it likely means that the pointer used to access the data was either not initialized or was corrupted.
    .
    [esp-idf] i2c core panic. Load prohibited. Exception was unhandled .
  • ADVERTISEMENT
  • #4 19468921
    mpier
    Level 29  
    Posts: 818
    Help: 153
    Rate: 141
    As I wrote. The eighth line of your first code.
  • I2C command sequence fixed for DS3231 read

    #5 19468938
    NIXIE_123
    Level 34  
    Posts: 2087
    Help: 288
    Rate: 609
    Thanks a lot. Bohemian error removed, works
    Code: C / C++
    Log in, to see the code
ADVERTISEMENT