Configure BMHD to the ABM mode

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

I would like set the ABM mode for BMHD0 for Aurix 2G (TC36x)

The content of BMHD0 on address 0xAF40000:
0D 00 59 B3  00 80 03 A0  EF 59 28 07  10 A6 D7 F8
The confitm pattern is set on address 0xAF4001F0:
34 12 21 43  00 00 00 00  00 00 00 00  00 00 00 00

0D - Mode selection by HWCFG pins is disabled + Alternate Boot Mode (ABM)

The content on ABMHD on address 0xA0038000:
04 C4 03 A0  59 B3 7C FA  00 80 03 A0  0F 80 03 A0
22 80 6D 2D  DD 7F 92 D2  43 43 F0 D4  BC BC 0F 2B

I expected the User Code Start Address will be 0xA003C404, but it looks like the BMHD0 is evaluated as invalid.

CRCs in the ABMHD are calvulated the same way as was calculated for BMHD0 for Aurix 1G (TC23x and TC27x).

Why the BMHD0 (the ABMHD) is evaluated as invalid and User Code Start Address is not set to STADABM.

0 Likes
1 Solution
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

I got it...

  • The End Address (CHKEND) must be word aligned, but calculated for all bytes (for example address 0xA003800C, but calculated till 0xA003800F)
  • STADABM: User Code Start Address in ABM mode must be word aligned

The issue in the second ABMHD was the User Code Start Address value. The Tasking V6.2r2p2 compiled is as 0xA03033EE and I do not konw why cannot by the User Code Start Address in ABMHD. If I change it to 0xA03033E0, recalculated CRC, then was set this value as the Address in ProgramCounter and BMHD0 as valid.

TX36x-ABM-OK1.png

Thank you for your time DW.

View solution in original post

0 Likes
13 Replies
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Dear Kochi,

UCB is a sensitive region to write, incorrect write operation will brick the chip.

Please contact your disti or FAE to get "UCB example code for BiFaces environment".

 

dw

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Dear DW,

I have experience with modify BMHDs include brick some chips years ago 🤔. However the Trace32 has a great tool for manipulate BMHDs include calculate CRCs for TC3xx. So I think the UCB with BMHD0 is correct. But base on the UserManual the ABMHD looks well too so why is evaluated as invalid? Maybe it would be very helpful, if you provide some working example for ABM mode - I can perhaps find the error in my ABMHD.

I have the BMHD1 write as a backup to prevent brick the chip. It is set to the Internal start from Flash mode with another User Code Start Addrres 0xA0300000 and it works.
0F 00 59 B3  00 00 30 A0  0D C9 46 60  F2 36 B9 9F

0F - Mode selection by HWCFG pins is disabled + Internal start from Flash

BR,

Kochi

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi kochi,

dw_0-1658385535392.png

Above is a simplified chart of ABM evaluation flow.

For AMB, there are 4 types of error: Header ID wrong;  STADABM invalid;  Header CRC wrong;  Code CRC wrong.

If you think your CRC algorithm is different with the MCU's, then you could use your CRC algorithm to compute the default CRC value and compare it with the default ABM's.

 

dw

0 Likes
Waldi
Level 4
Level 4
5 solutions authored 10 sign-ins 10 replies posted

You can try simple ABMHD:

04 C4 03 A0  59 B3 7C FA  00 00 00  00 00 00 00 00
00 00 00 00  00 00 00 00  5A A0 38  DA A5 5F C7 25

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Thank for reply Waldi.

I set the ABMHD as you wrote (I was able calculate the same CRC as you) and the BMHD0 is still invalid. The User Code Start Address is taken from BMHD1.

TX36x-ABM.pngReal User Code Start Address - 0xa0300000 - from BMHD1
Address of ABMHD - 0xA0038000

Do you have any other hint?

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi kochi,

If you have registered myICP, please download this application note:

https://myicp.infineon.com/sites/microcontrollers-aurix_customer_doc/Lists/defaultdoclib/AURIX%20TC3...

dw

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Thank you DW for the link,

I configured example of BMHD0 and ABMHD as described in the document: ABMHD located at 0xA0008000 (S2), TriCore ™ user code located at 0xA00F4000 (S61) but the User Code Start Address works as expected. The BMHD0 is evaluated as valid and the User Code Start Address is taken from ABMHD (0xA00F400).

There is only PINDIS configuration enabled in the example. So you need to be patient for set HW pins. Miminal the PIN P14.3 have to he High (Boot Mode selection from Flash BMI).

But I think the CRC is calculated over "different range" then is defined in ABMHD. End Address (CHKEND) must be word aligned.

ABMHD.CRCRANGE is calculated over 0xA0008000 - 0xA000800F, but the end address have to be defined as 0xA000800C. After then ABM works and the User Code Start Address (0xA003C404) is taken from ABMHD (0xA0038000).

0xA0038000: 04 C4 03 A0  59 B3 7C FA  00 80 03 A0  0C 80 03 A0
0xA0038010: 98 D1 64 B4  67 2E 9B 4B  4E FD 02 92  B1 02 FD 6D

TX36x-ABM-OK.png

If I apply the same configuration to another ABMHD on address (0xA0300000) it does not work and BMHD1 is used. Why?

 

0xA0300000: EE 33 30 A0 59 B3 7C FA 00 00 30 A0 0C 00 30 A0
0xA0300010: AD 1D 3C 6B 52 E2 C3 94 45 97 62 52 BA 68 9D AD

TX36x-ABM-NOK.png

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

dw_0-1658891121677.png

 

Hi Kochi,

As you said, 0xA000 8000 and 0xA00F 4000 are properly set in the ABMHD and BMHD0. Here I posted the key position in the Application Note.

Could you please check your CRC checksum again?

dw

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Hi DW,

I have an issue, the one my ABMHD wokrs on address 0xA003800 (after correct the End Address - CHKEND) and second ABMHD on address 0xA0300000 does not work.

I double checked the CRCs and all looks well for both ABMHDs. The calculation is the same for both.

TX36x-ABMHD-CRCs.png

My testcases see comment at Jul 26, 2022 05:46 AM:

  1. set STADABM of BMHD0 to address of first ABMHD (0xA0038000), recalculate CRC via Trace32 - ABM works
  2. set STADABM of BMHD0 to address of second ABMHD (0xA0300000), recalculate CRC via Trace32 - BMHD0 is evaluated as invalid
0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Or could you please try another address < 0xA00FFFFF in ABMHD?

Below is a chart of Flash Sectors

dw_0-1658920029553.png

 

dw

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

I got it...

  • The End Address (CHKEND) must be word aligned, but calculated for all bytes (for example address 0xA003800C, but calculated till 0xA003800F)
  • STADABM: User Code Start Address in ABM mode must be word aligned

The issue in the second ABMHD was the User Code Start Address value. The Tasking V6.2r2p2 compiled is as 0xA03033EE and I do not konw why cannot by the User Code Start Address in ABMHD. If I change it to 0xA03033E0, recalculated CRC, then was set this value as the Address in ProgramCounter and BMHD0 as valid.

TX36x-ABM-OK1.png

Thank you for your time DW.

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

You are welcome kochi.

Could you please confirm below two scenarios all be successful?

 

dw_0-1658982191343.png

 

 

 

dw

0 Likes
kochi
Level 1
Level 1
First solution authored 5 replies posted 5 sign-ins

Hi DW,

yes, these two scenerios work.

Small correction  in your second scenerio.

AF 40 00 00 -> A0 30 00 00
A0 30 00 00 -> A0 30 33 E0

Beset Regards,

      Kochi

0 Likes