cancel
Showing results for 
Search instead for 
Did you mean: 

Float or other format storing in SRAM

linas2
Associate II
Posted on September 01, 2012 at 14:33

Hello, i want to boost DFT speed so i need to calculate lot of sinf cosf  and store in external SRAM. internal is capable only for few dft points in spectrum, so i have to store them into SRAM, but don't know how to do that.

it work fine for 16b integers (i have 8Mb organized as 16b blocks)

i have this functions to read/write:

void SRAM_Write(uint16_t data, uint32_t WriteAddr);

int  SRAM_Read(uint32_t ReadAddr);

1 REPLY 1
Posted on September 01, 2012 at 16:12

The floats would be 32-bit IEEE 754 format.

float convert_u32_to_float(uint32_t x)

{

  return(*((float *)&x));

}

The bigger question is why you don't access the external memory directly, as it's presumably parked in the middle of the ARM's address space and directly accessible.

float *array_of_floats = (float *)0x60000000;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..