TC4xx promo banner Banner_Aurix_Competition Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_DevelopmentStudio


+ Reply to Thread
Results 1 to 5 of 5

Thread: Can't set Base of Interrupt Vector Table register (BIV)

  1. #1
    New Member New Member BEC is on a distinguished road
    Join Date
    Apr 2020
    Posts
    35
    Points
    167.5

    Can't set Base of Interrupt Vector Table register (BIV)

    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:
    Code:
    __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:
    Click image for larger version

Name:	mtcr_bug.PNG
Views:	0
Size:	93.4 KB
ID:	5174

    And here it is just after isync is run:
    Click image for larger version

Name:	mtcr_bug2.PNG
Views:	0
Size:	94.4 KB
ID:	5175

    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!

  2. #2
    Advanced Advanced
    Infineon Employee
    Infineon Employee
    MoD is on a distinguished road
    Join Date
    Feb 2012
    Location
    Munich
    Posts
    270
    Points
    5449.375
    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.
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member BEC is on a distinguished road
    Join Date
    Apr 2020
    Posts
    35
    Points
    167.5
    Quote Originally Posted by MoD View Post
    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:
    Click image for larger version

Name:	mtcr_runs.PNG
Views:	0
Size:	77.9 KB
ID:	5176

    BTV is not relevant to me in this specific case. I just need to somehow change BIV.
    Last edited by BEC; Oct 5th, 2020 at 04:38 AM.

  4. #4
    Advanced Advanced UC_wrangler will become famous soon enough
    Join Date
    Jun 2019
    Posts
    507
    Points
    10540
    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:
    Code:
        uint16 passwd = IfxScuWdt_getCpuWatchdogPassword();
    
        IfxScuWdt_clearCpuEndinit(passwd);
        __mtcr( CPU_BTV, 0x80002000 );
        IfxScuWdt_setCpuEndinit(passwd);

  5. #5
    New Member New Member BEC is on a distinguished road
    Join Date
    Apr 2020
    Posts
    35
    Points
    167.5
    Quote Originally Posted by UC_wrangler View Post
    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:
    Code:
        uint16 passwd = IfxScuWdt_getCpuWatchdogPassword();
    
        IfxScuWdt_clearCpuEndinit(passwd);
        __mtcr( CPU_BTV, 0x80002000 );
        IfxScuWdt_setCpuEndinit(passwd);
    Again to the rescue as always!
    Thanks! It worked

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.