C2000 Embedded Coder: Does Simulink flash the OTP?

8 次查看(过去 30 天)
Hello,
we are using the Texas Instruments Launchpad XL F28069M with the Simulink Embedded Coder Package for C2000 processors. We wanted to achieve that the Launchpad in Standalone mode (GPIO34=1, GPIO37=1, TRSTn=0) automatically boots from flash (which is the factory default). The brefore-mentioned pin settings should lead the bootloader into the GetMode where it then reads two One-Time Programmable (OTP) registers to determine the boot mode. It seems however that it currently boots into the Wait State (see spruh18f.pdf). This behavior can only be changed if the One-Time Programmable memory (OTP) of the chip is overwritten. Our question is: Does Simulink currently automatically write the OTP as part of an initial flash procedure? This would be inconvenient, since, in this case, we could not revert this behavior back to default.
Thank you

回答(1 个)

Antonin
Antonin 2019-3-22
编辑:Antonin 2019-3-25
Hi Offroad,
Standalone execution is our default boot for the F28069M LaunchPad. Make sure that you have the LaunchPad board selected in the configuration parameters of the model and the the "boot from flash" option is selcted in the build options. If "boot from flash" is not selected, we load in RAM which has the advantage of loading fast and executing fast but the code vanishes on a power cycle.
We don't touch the OTP with our default linker command files.
To be noted: When the JTAG part of the LaunchPad is not powered, (jumper1, 2 and 3 removed) and the board is powered externally (not from USB but maybe from a booster pack via the booster pack header pins), the floating reset pin may cause the board not to boot on a power cycle. In this case, you need to open the switch corresponding to the TRSTn, so the board is able to boot on a power cycle. Make sure to reconnect TRSTn every time you want to reprogram the board via USB. To start with, I recommend testing standalone while the board is powered from USB, with USB power cycles, this should work out of the box.
I hope it helps,
Antonin
  2 个评论
offroad
offroad 2019-3-25
Hi Antonin,
thank you for the thorough answer. Good to know that Simulink does not bake the OTP. Indeed we power the board externally (through our own power supply). It actually boots up standalone when we power it through USB. Do you happen to know how we could avoid having to flip TRSTn each time on a standalone boot?
Thank you.
Antonin
Antonin 2019-3-25
Hi offroad,
Keep JP1 and JP2 closed, that should do the trick.
The culprit is U7, it's an isolator that will pull the reset pin high in case the USB side is not powered. See section 9.4 of the following document for details:
When plugged, the USB power supply will fight with your external power supply to provide 3.3 and 5V. It's not ideal in theory, but we do it all the time here and I haven't seen any problem with this. At least when you do your development it avoids having to flip TRSTn. Once you have a more permenant setup, then you can remove the jumpers and flip the TRSTn when needed.
I hope it helps, good luck!
Antonin.

请先登录,再进行评论。

产品


版本

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by