I'm trying to use the FIFO XRAM memory on the EFM8UB11 as general XRAM. I would like to just use the Keil C compiler to do this, or I would like an example of how to add inline assembly to do it. For the other bank of XRAM I just use "xdata" when defining the variable -
uint8_t xdata junkvariable;
I'm hoping there's an easy way to do this -
I think if I can figure out how to change the linker directive from
XDATA(X:0x0 - X:0x3ff)
XDATA(X:0x0 - X:0x7ff)
that might work. But I can't find where this is specified yet.
that might work.
Yes, but keep in mind that you have to enable USBCLK. Otherwise, the FIFO memory will not be accessible.
But I can't find where this is specified yet.
I'd try it in the linker's miscellaneous options, see screenshot.
Similar theory may apply to EFM8UB11F16G-C-QSOP24.
Update - I added the linker flag. That eliminated my compile errors. I also enabled the USBCLK.
Now I can compile the code. I added a 1k variable array to XDATA, which places all my other variables above 0x400. The map file shows the variables in the data area I expect, and I appear to be able to program the device, but the code won't run correctly. Also the debugger won't work.
I would like someone from Silicon Labs to write a simple example just placing a variable in the XRAM USB fifo space, that will do a correct write and read from that variable. I'm not sure what I'm missing... The datasheet just mentions that this can be done, and just that the USB clock needs to be active.