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

Can I pass parameters to my project?

Hi,

I have a small project which carries out memory testing when loaded into my target hardware (C165 Based).

At the moment, I have to hard-code the
address at which the memory test starts testing and the range of memory to be tested.

This involves re-building each time I wish to execute the test on a different area of memory, or different device.

A colleague is creating a custom 'monitor' which will 'locate' the test code in a designated area and run it, however we would like to know how we could pass the above parameters (start address, range) to the test code, thus avoiding rebuilding the code each time.

I think what I'm asking is how I pass parameters to 'main' when the code is being loaded into the target.

If this is a ludicrous suggestion, I apologise!

Many thanks....James

Parents
  • You could declare a variable in ram at a fixed location using the linker. If you download as intel or motorola hex, you could probably make the change by modifying a single line in the hex file.

    For example, I have declared a CRC variable at address 0xdffe. I add a hex record to the end of my hex file which initializes this variable with the crc of my code to be used during self test.

    :02DFFE00B74921

Reply
  • You could declare a variable in ram at a fixed location using the linker. If you download as intel or motorola hex, you could probably make the change by modifying a single line in the hex file.

    For example, I have declared a CRC variable at address 0xdffe. I add a hex record to the end of my hex file which initializes this variable with the crc of my code to be used during self test.

    :02DFFE00B74921

Children
No data