Hi,
I can not get through with ROM-based constants.
When I put a definition:
const char txtParcer_OK[] = "ok! this is sample message ...";
the compiler resides the message in RAM area. I need ROM area.
I use µVision V4.20.03.0 Tool Version Numbers: Toolchain: MDK-ARM Standard Version: 4.20 Toolchain Path: BIN40\ C Compiler: Armcc.Exe V4.1.0.644 Assembler: Armasm.Exe V4.1.0.644 Linker/Locator: ArmLink.Exe V4.1.0.644 Librarian: ArmAr.Exe V4.1.0.644 Hex Converter: FromElf.Exe V4.1.0.644 CPU DLL: SARMCM3.DLL V4.20 Dialog DLL: DARMCM1.DLL V1.7.0.0 Target DLL: Bin\Nu_Link.dll V1.18 Dialog DLL: TARMCM1.DLL V1.06
Best regards, Alex.
Are you compiling in C++ mode? I hear, in C++ the meaning of const is different from C. Could this be it?
Hi Mike!
No Mike, I am compiling in plain C mode.
Usually, if to put code or static qualifier in first place of constant definition, it works, but here - it does not.
As for local variable - I am not sure. The const is defined in the beginning of the module. Not inside any function. Is it local? Not? I think - it should not be local. May be, I should define it globally by putting extern definition in .* file? I just have tried - in vain.
Thank you for help, Alex.
Alex,
are you sure? I am too using Nuvoton's M0 with a lot of cons char's (fonts) and all is placed where it should be. What does the linker say?
- Dejan
Did you try
static const acText[]= "...";
?
This should definitely work.
Hi b t.
Yes, I have tried all the ways. And this - too.
I have read posts for C166, for C51 - everywhere it works, but not for Keil uVision, it seems.
Alex.
View all questions in Keil forum