Accessing general purpose flash from Xbee900HP processor (freescale)

I’m currently trying to take advantage of the XBEE Pro’s general purpose flash memory. It’s fairly straightforward to access the flash from another xbee (see General Purpose Flash Memory section in XBee PRO 900 HP Product Manual) via an api request. The explicit api request is made to the DIGI_DEVICE endpoint(0xE6) with the correct calls to the memory management cluster (0x0023) and then you use their bytes for memory commands etc. What is NOT clear, is how I access this memory from a C program written onto the processor itself.

Any tips would be appreciated.
Things I’ve tried:

  1. I looked into veeprom, but found out that those areas of memory are not overlapping / the same.

2.Creating an envelope to “send to myself” with the correct information above. It didn’t seem to take. See below for a very ham-fisted approach attempt.

uint8_t env_buffer[8];
wpan_envelope_t envelope;
envelopee.cluster_id = 0x0023;
envelopee.source_endpoint = 0xE6;
envelopee.dest_endpoint = 0xE6;
envelopee.profile_id = 0xC105;
env_buffer[0] = 0x04;
env_buffer[1] = 0x00;
env_buffer[2] = 0x00;
env_buffer[3] = 0x00;
env_buffer[4] = 0x00;
env_buffer[5] = 0x00;
env_buffer[6] = 0x00;
env_buffer[7] = 0x06;
envelope.payload = env_buffer;
envelope.length = 8;

If there’s anything obvious that I’m missing (simple pointer to the correct memory area with a memcpy read) that would be great.

Many thanks

p.s. to others. you have to be careful about bit width. all indexes are uint16s (2 bits wide).

if I recall you need to do the same API calls.

Okay so let’s say I make and send the api call as I did above. How do you program an explicit handler for that response? The radio doesn’t seem to pick up the response like a normal message sent to it (e.g. via ENABLE_XBEE_HANDLE_RX).

It would also seem that sending a message over the network to “yourself / your address” is the wrong way to do it. Any tips on addressing the radio directly? Do I just need to mess around with the at_cmd_local example until I understand how frames/frame handlers work? Any documentation available on the frames style of programming?

Thanks once again.

No, this would be correct. Sending a ZDO command is what you need to do to access that function. Simply putting the Modules mac address in tells the radio to either send it to that module with that address or if that address is it’s self, to run the rest of the ZDO function without sending it over the RF port.

As for the XBee handle function you may want to do some more research within the help files to see if that is to be used for ZDO commands or if they are are other ones for that. Also make sure to set the AO command to send out all explicit frames including unsupported ZDO commands.