Domanda

I want to read the MAC address for the Bluetooth LE chip CC2541. This is stored in memory location 0x780C. I went through the

osal_snv_read

function but I don't know what osalSnvId_t id is. A brief explanation about how this workds would be really helpful.

È stato utile?

Soluzione

Apparently the location where MAC address is stored cannot be read using osal_snv_read. So either I have to use

GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);

after

GAPROLE_STARTED

or I have to use

__xdata __no_init uint8 mac_id[6] @ 0x780C;

__xdata to say it is reading from XDATA memory and __no_init to tell the compiler not to initialize this variable. Also, this had to be kept outside any function to prevent it from declaring as auto variable.

Credits: http://e2e.ti.com/support/low_power_rf/f/538/t/273968.aspx

Altri suggerimenti

osalSnvId_t is a typedef for a uint, either uint8 or uint16. The value will be between 0x00 and 0xFF.

The lower values up to 0x7F are reserved for Zigbee and these locations will be defined with macros somewhere in the header files.

You can use values from 0x80 to 0xFE for your own purposes.

osal_snv_write( 0x80, 6, "hello" );
osal_snv_read( 0x80, 6, mybuf );
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top