Hello,
It seems that binary option ("--binary") in C2000 Hex utility doesn't generate all words, specifically there are 4 missing. 2 0x0000's right before .text section, and the other 2 0x0000's between .text and .econst sections. Then, as this 4 words are not generated, at some point when linking a function call, an illegal instruction is executed because of the FLASH data shifting.
This problem doesn't happen if, instead of using "--binary" option, "--array" option is used. This option generates an ASCII file with a const variable initialized with all the data properly set (including the 4 missing wordst). It works perfect.
With this problem, if I want to generate with "--binary" option then once it is programmed into FLASH it will not work. As a temporary solution I can generate with "--array" option and implement a python script which converts the ascii generated file into a binary file, although there should not be need for that.
Can anyone tell me why those 4 words are missing or confirm that it is a bug from "--binary" option in C2000 Hex utility?
PD: if anyone wonders why I want to use "--binary" option when "--array" option works, the answer is that they are for different purposes. I was doing a little example to program FLASH with a hardcoded binary (which should be done with "--array" option) but in case you want to implement a full bootloader with a communication interface (which is what I am doing right now) then the right option is "--binary".
Best regards,
Adria