Hello everyone,
I'm using an LPC54628 with SDK 2.9 and trying to use the USB RAM (at addresses 0x40100000 to 0x40101fff) as additional ordinary RAM. So I do:
POWER_EnablePD(kPDRUNCFG_PD_RAM3);
In the Memory View after this instruction, instead of all ff all 00 is displayed. So power is actually on, it seems.
Then I do:
unsigned int *i = (unsigned int *)0x40101ffc;
*i = 0x12345678;
But that doesn't do anything. I then enabled USB0 clock, USB1 clock and USBPLL clock in the Clocks Tool, rebuilt and redebugged but no luck neither.
I also put .bss.* data via the managed linker script there (which was the idea, obviously) but the failed asserts tell that no values could be written there.
What am I missing? Do I have to set another register bit to make that area writable?
you have to enable the usb ram clock:
CLOCK_EnableClock(kCLOCK_UsbRam1);
Hello hoberg,
There is a demo steps you can refer to:
1) Create USB RAM space to save data:
2) Initialize data to USB RAM:
I attached the test project to you, you can have a look.
This project base on LPC55s69, the same method with LPC54628.
BR
Alice
Hi, Alice.
First off: Thank you for this quick reply. I opened this thread just before I finished work for the day and when I started today, your answer just sat there waiting for me. Perfect!
Then I unpacked the example and had a good look at it.
I tried your suggestions. I already had the USB_RAM section yesterday, labelled RAM3. So I did
#include "cr_section_macros.h"
__DATA(RAM3) uint32_t array[10];
in global scope. Later I did
POWER_EnablePD(kPDRUNCFG_PD_RAM3);
array[0] = 0x01234567;
array[9] = 0x89abcdef;
and then stepped through the code. The address of array is correct:
But as you can see, all data is 0. In fact, all the USB_RAM is 0s. I tried omitting the POWER_EnablePD() line but then instead of 0s I get all 0xFFFFFEFFs (i.e.: 4294967039s).
Seems to me like for some reason the USB_RAM section is not writable. Odd.
Kind regards.
Garry
Hello Garry,
Could you please share your project or a simple project that can reproduce your issue, I will check it on my side, thanks.
BR
Alice
I'm afraid the hardware design is going to change such that it includes an external RAM and I won't pursue this route any longer.