• sprintf causing a hardfault exception
    Had to add some data logging in a hurry to diagnose an issue. A function is passed a pointer to data that is then used to assemble a readable string that's then stored on a SD card the RTOS task...
  • alloc ram causes hardfault
    Hello, I'm using a lpc1766 and made a very simple program to debug a hardfault exception. After initiallisation the main routine is called where a array is allocated using the library function...
  • how to determine the cause of HardFault
    os_evt_wait_or(CHECK_EVENT_FLAGS, INFINITE_TIME); //Wait for an Event to occur rx_event = os_evt_get(); switch(rx_event) { case EVENT_INTERRUPT: if(chkflg) { dif = difftime(_gettime(), setalrm); if...
  • Packed structs unaligned access
    I'll start with a code sample typedef struct { uint16_t len; uint16_t crc; uint8_t data[1]; } __attribute__ ((packed)) packet_t; typedef struct { uint64_t timestamp; uint8_t val1, val2, val3...
  • Unaligned access problems
    Note: This was originally posted on 1st June 2009 at http://forums.arm.com We had written some code for an ARM Cortex M3 platform. But now, we have to port it to an ARM7TDMI based controller in very little...