Oct 05, 2020
01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2020
01:44 AM
Hello.
I need to change the BIV during runtime. (For T297 using Tasking Compiler)
Now, BIV is a Core Spacial Function Register, so I know you can't just alter it and need to use __mtcr()
__mtcr() works for other registers such as SYSCON and PSW, but for some reason fails to work for BIV?
Here is my code and the assembly generated:
For some reason, nothing changes:
Here is the registers just before the mtcr mnemonic is run:

And here it is just after isync is run:

For some reason only PC has changed (obviously) but not BIV 😞
Anyone know why this happens? Are BIV/BTV special and need a special way to change them?
Thank you and have a great week!
I need to change the BIV during runtime. (For T297 using Tasking Compiler)
Now, BIV is a Core Spacial Function Register, so I know you can't just alter it and need to use __mtcr()
__mtcr() works for other registers such as SYSCON and PSW, but for some reason fails to work for BIV?
Here is my code and the assembly generated:
__mtcr(CPU_BIV, 0x80002000);
//[Assembly]
mov d15, #0x2000
addih d15, d15, #-0x8000
mtcr #0xFE20, d15
isync
For some reason, nothing changes:
Here is the registers just before the mtcr mnemonic is run:
And here it is just after isync is run:
For some reason only PC has changed (obviously) but not BIV 😞
Anyone know why this happens? Are BIV/BTV special and need a special way to change them?
Thank you and have a great week!
4 Replies
Oct 05, 2020
03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2020
03:33 AM
BIV and BTV are equal, there is no different way to change them. It seems that your SW don't call the code for changing the BIV or the BIV will be set to 0. The BTV will be set from your software (Reset value is 0xA0000100). Check in your software what is different.
Oct 05, 2020
04:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2020
04:10 AM
MoD wrote:
BIV and BTV are equal, there is no different way to change them. It seems that your SW don't call the code for changing the BIV or the BIV will be set to 0. The BTV will be set from your software (Reset value is 0xA0000100). Check in your software what is different.
Ok.
But what are the correct lines of code to change them?
I thought it is __mtcr but it doesn't seem to work
The assembly code I wrote does run I have checked, the issue is that it doesn't do anything:
BTV is not relevant to me in this specific case. I just need to somehow change BIV.
Oct 05, 2020
06:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2020
06:06 AM
Some registers are endinit or safety endinit protected. Check out 5.8.8 Summary of CSFR Reset Values and Access Modes on page 321 of tc29xB_um_v1.3.pdf: the "CEx" in BTV means that the register is endinit protected, so you'll need to surround your MTCR with a clear/reset sequence. Something like this will work:
uint16 passwd = IfxScuWdt_getCpuWatchdogPassword();
IfxScuWdt_clearCpuEndinit(passwd);
__mtcr( CPU_BTV, 0x80002000 );
IfxScuWdt_setCpuEndinit(passwd);
Oct 05, 2020
07:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 05, 2020
07:21 AM
UC_wrangler wrote:
Some registers are endinit or safety endinit protected. Check out 5.8.8 Summary of CSFR Reset Values and Access Modes on page 321 of tc29xB_um_v1.3.pdf: the "CEx" in BTV means that the register is endinit protected, so you'll need to surround your MTCR with a clear/reset sequence. Something like this will work:
uint16 passwd = IfxScuWdt_getCpuWatchdogPassword();
IfxScuWdt_clearCpuEndinit(passwd);
__mtcr( CPU_BTV, 0x80002000 );
IfxScuWdt_setCpuEndinit(passwd);
Again to the rescue as always!
Thanks! It worked 🙂