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

string pointer and static address problem

Hello,

My problem is as following. I have a string array, If I delete last string of GprsErrors or pointer of GprsErrors, if I make const pointer. I don't get error.

I'm using some static addresses(0x20000309, 0x20000308 .....), I guess, Keil is trying to write static address so I get the following error.

Keil shows as fgetc_b.o and constant.o overlap, I didn't find the source of the problem.

what is my fault? or How can I find and solve the problem?

Thanks alot.

Kutay,

..\Output\Project.axf: Error: L6971E: fgetc_b.o(.data) type RW incompatible with constants.o(.ARM.__AT_0x20000309) type ZI in er RW_IRAM1.

char const * GprsErrors[]={
    "BAUDRATE",
    "AT CMD",
    "ATE0 CMD",
    "BAT INIT",
    "PIN CODE",
     .....

     ".....",       // I'm deleting this string and I get no error(everything is ok)
};

Parents
  • First off - try to avoid playing debugger, i.e. try to avoid raw memory addresses used externally.

    Next thing - if you really need to, you should build a table of indices. So just store a single pointer to this table at a known, and well selected, address - possibly first or last in RAM or last in flash.

    Then use this pointer to access the table of addresses to important data structures you want to be able to remotely retrieve.

    But do not (!) do make this into a two-way interface. If you really need to control something in your embedded device, then you really should send _commands_ to it. Only then will your program be able to decide on the best time to perform the commands. You might like to pick up newpaper, letters, ... from the mailbox. But you wouldn't much like if unknown people walked into your home and placed mail or boxes on a table or the floor somewhere just because they had the access and felt that gave them the right...

    In the end, raw accesses are really problematic and something to avoid like the plague.

Reply
  • First off - try to avoid playing debugger, i.e. try to avoid raw memory addresses used externally.

    Next thing - if you really need to, you should build a table of indices. So just store a single pointer to this table at a known, and well selected, address - possibly first or last in RAM or last in flash.

    Then use this pointer to access the table of addresses to important data structures you want to be able to remotely retrieve.

    But do not (!) do make this into a two-way interface. If you really need to control something in your embedded device, then you really should send _commands_ to it. Only then will your program be able to decide on the best time to perform the commands. You might like to pick up newpaper, letters, ... from the mailbox. But you wouldn't much like if unknown people walked into your home and placed mail or boxes on a table or the floor somewhere just because they had the access and felt that gave them the right...

    In the end, raw accesses are really problematic and something to avoid like the plague.

Children
No data