This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Mapping all my memory!

Hi people,
I would want to have a small favour done.In my applications I really don't require to worry abt using different memory types or specify models or handle data and program storage destinations.
Here are the few basic blocks that I work with:
89c52 with no external mem
89c52 with no external mem but interfaced to 9 UARTS thru PAL logic and memory mapped I/O
80c320 with 32K ext RAM and the 28f001 as ROM
89c51 RD2 with no external mem
Now for the problem...
There r no straight guidelines while setting Target Options for the A51,BL51,C51 and I really get confused.
The memory specifications also create questions.
Is there no straight method dependant only on the memory model that will create a nicely compiled code.
What currently happens is the pointers that I use give me various errors all related to memory!!
I have deliberately not posted the errors I get because I wanna go thru the learning cycle.Of course if my problem's not solved that's the next thing I'll do!
Actually most of the code I write has already been tested and verified using the old dunfield command line compiler.
Please help make my compiling just as simple using uv2.
Thanks anyway,
Gautam

Parents
  • My project happens to have memory-mapped hardware residing at 0xF000. I have no trouble accessing it.

    For the uVision target dialog, I told the tools that they had xdata ranging from 0x4000 to 0xA000. (I was saving 0xA000-0xEFFF for a software stack and memory pool; 0-0x3FFF is used for a different purpose.) So I've made the linker's job relatively complex.

    To access the registers of my device, I've got some macros to declare the registers that essentially boil down to:

    *(volatile U32 xdata*)(0xF000 + offset)

    Could you post the code that gives you the "invalid mem space" error? If you have no xdata at all in your project, perhaps you need to tell the toolchain about your UART at 0xc800 (and reserve the address range of the registers, just to be safe). Or perhaps you're not using an explicit memory type qualifer for your pointer? How exactly do you generate the address for your register access?

Reply
  • My project happens to have memory-mapped hardware residing at 0xF000. I have no trouble accessing it.

    For the uVision target dialog, I told the tools that they had xdata ranging from 0x4000 to 0xA000. (I was saving 0xA000-0xEFFF for a software stack and memory pool; 0-0x3FFF is used for a different purpose.) So I've made the linker's job relatively complex.

    To access the registers of my device, I've got some macros to declare the registers that essentially boil down to:

    *(volatile U32 xdata*)(0xF000 + offset)

    Could you post the code that gives you the "invalid mem space" error? If you have no xdata at all in your project, perhaps you need to tell the toolchain about your UART at 0xc800 (and reserve the address range of the registers, just to be safe). Or perhaps you're not using an explicit memory type qualifer for your pointer? How exactly do you generate the address for your register access?

Children
No data