This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory access error at starting debug session after setting up asynchrounous clock of SPI or I2C

Hello,
I´ve got a big problem with my µvision project for the LPC54102J512. If I have initialized the clock for any peripheral of the asynchronous block once there is no way to start a debug session.
I only enabled the clock for the IOCON block, the clock for GPIO-Port0 and -Port1, asserted a reset at both GPIO-Ports, defined Pin0_29 as GPIO, set its direction as output and toggled the state of the GPIO-Pin in a loop.
If there is no access to the asynchronous block it works fine. Only if I enabled the clock for SPI or I2C and started the debug session, nothing works.
Here´s my code of the main.c:

main.c

#include "LPC54xxx.h"
#include "cmsis_os.h"

int main(void)
{
        if(!osKernelRunning())
        {
                //Aufruf dient der Kompatibilität gegenüber späteren CMSIS-RTOS Versionen
                if(osKernelInitialize() != osOK)                        //initialize CMSIS-RTOS
                {
                        //TODO: Fehlerbehandlung, Initialisierung fehlgeschlagen
                }
        }

        osKernelStart();        //start executing

//      LPC_ASYNCSYSCON->ASYNCAPBCLKCTRLSET |= (1 << 5);               //enable clock for I2C

//      LPC_SYSCON->AHBCLKCTRLSET0 |= (1<<13); //enable access to IOCON block
//
//      LPC_SYSCON->AHBCLKCTRLSET0 |= (1<<14); //set clock for GPIO-Port 0
//      LPC_SYSCON->AHBCLKCTRLSET0 |= (1<<15); //set clock GPI0-Port 1
//      LPC_SYSCON->PRESETCTRLSET0 |= (1<<14);         //Reset GPI0 Port 0
//      LPC_SYSCON->PRESETCTRLCLR0 |= (1<<14);         //Clear Reset GPIO-Port 0
//      LPC_SYSCON->PRESETCTRLSET0 |= (1<<15);         //Reset GPIO-Port 1
//      LPC_SYSCON->PRESETCTRLCLR0 |= (1<<15);         //Clear Reset GPIO-Port 1
//
//      LPC_IOCON->PIO0_29 &= ~(0x07<<0);          //define Pin0_29 as GPIO
//      LPC_GPIO->DIR0 |= (1 << 29);                   //set direction as output


//      osKernelStart();        //start executing

        while(1)
        {
//              LPC_GPIO->PIN0 |= (1 << 29);
//              osDelay(500);
//              LPC_GPIO->PIN0 &= ~(1 << 29);
//              osDelay(500);
        };
}