This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/TM4C1294NCPDT: How to modify BIOS code and rebuild it effectively?

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

How to modify BIOS code and rebuild it effectively?

tm4c1294ncpdt
CCS6.1.3
tirtos_tivac_2_10_01_38
compiler: TI V5.1.11
XDC: 3.30.4.52

In the .cfg file, BIOS lib type is set to custom, so when rebuild the app project, the BIOS lib should also be rebuilt. But I found something wrong:
1. Modify sysbios/BIOS.h by adding more members to "struct ti_sysbios_BIOS_Module_State".
2. Rebuild
3. I found in configPkg/package/cfg/APmain_pem4f.c, ti_sysbios_BIOS_Module__state__V doesn't contain new members.

So what is wrong? Thanks.

  • Jianyi Bao,
    header files in SYS/BIOS are automatically generated, so whatever change you made was written over. You would need to change Module_State in BIOS.xdc file. However, that's really an advanced topic because it's not enough just to add members to Module_State, you also have to ensure that they are properly initialized in BIOS.xs. You can try explaining what you are trying to do, there might be an alternative approach.
  • Please see "e2e.ti.com/.../636949". My app asserted at "BIOS_getThreadType()", so I want to add some variables before and after ti_sysbios_BIOS_Module_State.threadType in the struct, and initialize them to some fix value (such as 0x12345678) in BIOS_start. When the assert happens, I could check these variables. If they are changed, then probably some wild pointer changes RAM unexpectly. This could help solve the issue.

    Thanks.

  • I guess adding extra variables to Module_State might work. So, add these variables to Module_State in BIOS.xdc, and then initialize them in BIOS.xs in function module$static$init().
    You'll see the statements
    mod.rtsGateCount = 0;
    mod.rtsGateKey = 0;
    at the top of that function. Assuming your new variables are 'before' and 'after', you'll need to add
    mod.before = 0x12345678;
    mod.after = 0x12345678;
  • Hi, it's not working.

    1. Adding new member to BIOS.xdc seems OK, but initialization in BIOS.xs will report "XDC runtime error: ti.sysbios.BIOS.Module_State#0: no element named 'protect_pre_1'"
    2. After removing the initialization in BIOS.xs, the generated APmain_pem4f.c still doesn't contain new member.
    3. Actually BISO.h is not auto genrated during the compiling.

    So it looks that "BIOS.xdc" is not part of rebuilding.

  • Rebuilding only the project is not going to help. You need to go to the top directory of your TI-RTOS installation and follow instructions in tirtos.mak, and in Section "Rebuilding TI-RTOS" in User's Guide. Only then your changes in BIOS.xdc will be reflected in BIOS.h.
  • Thanks Sasha. I rebuild it with gmake, and it works now.