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

Cypress AN2131 DevKit and Keil Compiler/Debugger

Hello,

I've been trying to understand how to configure the memory on my Cypress AN2131 EZ_USB Development Kit, using the Keil Debugger interface, and I am struggling to get it to work. I find that Malloc will not work when called from my C code. I intend to try to use the small model, with all my data variables in the first 6.8k of internal memory space, and with up to 64k of external program memory.

Also I hope to use a lot of pointers to access two-dimensional linked lists held within AN2131 Internal memory, and I am finding that fairly simple lines of C code result in 20 or more hex bytes. Is this as to be expected, or is there a compiler option which I am missing.

I'd be grateful for any help,

Andrew Murray

Parents
  • small model, with all my data variables in the first 6.8k of internal memory space

    The 'Small' model uses the internal DATA space within the 8032 CPU Core - this is not to be confused with any extra RAM which may be on the same chip, but not within the CPU core!
    Some "internal" memory is more "internal" than others!

    The Internal data space used in the Small model is addressed using 8-bit registers; therefore it cannot be bigger than 256 bytes!

    Also I hope to use a lot of pointers

    Be sure to read fully the documentation on Keil's pointer implementation; particularly Generic vs Memory-Spcific Pointers
    (Unfortunately, Keil use the term "Generic" with a different meaning to the rest of the 'C' world!)
    This is particularly important if you're using pointers to functions.

    I am finding that fairly simple lines of C code result in 20 or more hex bytes

    Well, that's the whole point of writing in a high-level language, isn't it!? - It allows the programmer to just write one simple statement and leave all the donkey-work of implementing the corresponding tranche of machine code to the compiler!

Reply
  • small model, with all my data variables in the first 6.8k of internal memory space

    The 'Small' model uses the internal DATA space within the 8032 CPU Core - this is not to be confused with any extra RAM which may be on the same chip, but not within the CPU core!
    Some "internal" memory is more "internal" than others!

    The Internal data space used in the Small model is addressed using 8-bit registers; therefore it cannot be bigger than 256 bytes!

    Also I hope to use a lot of pointers

    Be sure to read fully the documentation on Keil's pointer implementation; particularly Generic vs Memory-Spcific Pointers
    (Unfortunately, Keil use the term "Generic" with a different meaning to the rest of the 'C' world!)
    This is particularly important if you're using pointers to functions.

    I am finding that fairly simple lines of C code result in 20 or more hex bytes

    Well, that's the whole point of writing in a high-level language, isn't it!? - It allows the programmer to just write one simple statement and leave all the donkey-work of implementing the corresponding tranche of machine code to the compiler!

Children
No data