Bug report: flash configuration issue on twrk60f120 in MQX 3.8.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug report: flash configuration issue on twrk60f120 in MQX 3.8.1

537 Views
alipoth
Contributor III

In MQX 3.8.1 the file mqx/source/bsp/twrk60f120m/cw/intflash.lcf incorrectly places the flash configuration data at 0x410 instead of 0x400. The actual configuration field ends up being filled with zeros, which results in a secured CPU (debug is disabled). CodeWarrior's flash programmer hides the issue by making sure the flash configuration is valid. Using other firmware loader tools or methods (e.g. over-the-air programming), which program the image verbatim, will be affected by the bug and may end up with undesirable security settings.

The fix is trivial, see the diff output below:

--- MQX-3.8.1-original/mqx/source/bsp/twrk60f120m/cw/intflash.lcf

+++ MQX-3.8.1-fixed/mqx/source/bsp/twrk60f120m/cw/intflash.lcf

@@ -1,7 +1,7 @@

MEMORY

{

-   vectorrom   (RX): ORIGIN = 0x00000000, LENGTH = 0x00000410

-   cfmprotrom  (RX): ORIGIN = 0x00000410, LENGTH = 0x00000010

+   vectorrom   (RX): ORIGIN = 0x00000000, LENGTH = 0x00000400

+   cfmprotrom  (R):  ORIGIN = 0x00000400, LENGTH = 0x00000020

    rom         (RX): ORIGIN = 0x00000420, LENGTH = 0x0007FBE0  # Code + Const data  

    ram         (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000  # SRAM - RW data


0 Kudos
2 Replies

366 Views
BielikM
Contributor III

Hi Andras ,

Thank you for your report and fix and  will be applicate in nex release 4.0.0

0 Kudos

366 Views
c0170
Senior Contributor III

Hello Andras Lipoth,

thank you for reporting the bug. I can confirm this is valid for twrk60f120. Vector table size should really be 0x400 and flash configuration data located at 0x400.

We will fix this linker command file :smileywink:

Regards,

MartinK

0 Kudos