lpcware

[SOLVED] Accessing CLK_USB0_CFG crashes core

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by chris_bayley_trimble on Wed Jan 07 17:50:22 MST 2015
I'm having a very frustrating time with the USB_CLK registers. Any access to any of the 4 USB CLK registers (CLK_USB0_CFG:0x40051800, CLK_USB0_STAT:0x40051804, CLK_USB1_CFG:0x40051900, & CLK_USB1_STAT:0x40051904) causes my 4357 (I've also tried a 4330) to become unresponsive and loose comms with the debugger. I can access the adjacent CLK control registers at 0x40051700 and 0x40051a00 without issue.

the code below demonstrates the problem:


    volatile uint32_t* ptr;
    volatile uint32_t val;

    // This works
    ptr = (uint32_t*)0x40051700; //CLK_PERIPH_BUS config
    val = *ptr;
    // This works
    ptr = (uint32_t*)0x40051704; //CLK_PERIPH_BUS status
    val = *ptr;
    // This works
    ptr = (uint32_t*)0x40051A00; //CLK_SPI_CFG
    val = *ptr;

    // This crashes the debugger/core
    ptr = (uint32_t*)0x40051800; //CLK_USB0 config
    val = *ptr;
    // This crashes the debugger/core
    ptr = (uint32_t*)0x40051804; //CLK_USB0 status
    val = *ptr;
    // This crashes the debugger/core
    ptr = (uint32_t*)0x40051900; //CLK_USB1 config
    val = *ptr;
    // This crashes the debugger/core
    ptr = (uint32_t*)0x40051904; //CLK_USB1 status
    val = *ptr;


It is also true that I cannot access that memory via the debugger, if I add the expression
*0x40051800
to expressions windows I will loose connection to the target immediately.

I have tried the access first thing before board init and later on after USB is already running, the result is always the same.
I have scanned the errata for the 43xx but can find nothing relevant.

Help !

Cheers,
Chris

Outcomes