NOTE: This is a *solved* problem. I wrote this up as a question,
promptly followed by finding the answer. I'm posting anyway so others
might be able to find it on Google. As usual, the answer lay in RTFM.

  I was running into an issue where if I had something like:

__xdata uint8_t nop[5] = { 0x04, 0x60, 0x00, 0x00, 0x00 };

  Then I'd find the initial values in an XINIT section, were I assume
_mcs51_genXINIT() copies into the XISEG section on startup/reset. The
problem was that it wasn't being initialized when I halted the
processor and read out the XISEG addresses. But if I did this:

__xdata __at 0xe000 uint8_t nop[5] = { 0x04, 0x60, 0x00, 0x00, 0x00 };

  Then the data was alright and my firmware ran as expected.

  The solution was in the SDCC manual under 4.1.1 pdata access by SFR.
The Cypress EZ-USB FX2 chip needs to have _XPAGE defined to MPAGE (sfr
@ 0x92) as specified in EZ-USB Technical Reference Manual, version
1.4, 11.12 Special Function Registers (SFR).

  As

-- 
- Tristan -

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to