TIP of the day: Changing XMC1000 Boot Mode Index (BMI)

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

cross mob
Not applicable
Boot Mode Index (BMI) can be change via Memtool.
First, connect the device with Memtool. The device can be connect via UART BSL if the device is in UART BSL mode or connect via DAS if the device in SWD or SPD mode.
For connect via DAS, Infineon miniWiggler is required.
Next, go the "Setup" in Memtool and select the "Protection/BMI" tab.
Check on the box of "Intall BMI configuration" and choose the Boot Mode you want to change, then click "OK".
The next go to "HW Protect", select "Change current Protection and BMI configuration" and click "Start".
Once it is done, Memtool will prompt "Protection operation failed" as we do not set anything for the protection.
Then reset your device and it will go into the boot mode you have selected.

WARNING: You must know what you are doing. Once you have changed the BMI, you must have the mean to connect to the device using the mode you have change.
0 Likes
14 Replies
Arno
Employee
Employee
25 replies posted 10 replies posted 5 replies posted
There is another method to set the BMI by calling a ROM routine.
This DAVE-example first checks on current BMI and changes BMI to requested one only if not yet installed.


#include //Declarations from DAVE3 Code Generation (includes SFR declaration)

/* Constants definitions */
// Start address of the ROM function table
#define ROM_FUNCTION_TABLE_START (0x00000100)
#define _BmiInstallationReq (ROM_FUNCTION_TABLE_START + 0x08)

// Pointer to Request BMI installation routine
#define XMC1000_BmiInstallationReq (*((unsigned long (**) (unsigned short)) _BmiInstallationReq))
#define BMI (*(uint16_t*) 0x10000E00)

#define SPD0 (0xF9C3) // SPD0 (P0.14) with User Mode Debug
#define SWD0 (0xF8C3) // SWD0 (P0.14, P0.15) with User Mode Debug

#define BMI_MODE SPD0

void ChangeBMI(void)
{
// Call the BMI_installation routine to set BMI
if( BMI != BMI_MODE )
{
XMC1000_BmiInstallationReq( BMI_MODE );
while(1);
}
}
0 Likes
Not applicable
Jackson, thanks for the useful information. You mentioned that "the device can be connect via UART BSL if the device is in UART BSL mode or connect via DAS if the device in SWD or SPD mode.". How can I find what is the current BMI mode configured on the chip?. I mean what will be the default factory settings for BMI.

Thanks in advance.
0 Likes
Arno
Employee
Employee
25 replies posted 10 replies posted 5 replies posted
Default of the device is UART BSL. The boot kits come with SWD DEBUG mode.
SWD is fully supported by SEGGER J-LINK LITE which is the debug interface of the boot kits. This interface is also supported by DAVE debugger.
0 Likes
Not applicable
I'm using the SEGGER J-LINK LITE debug interface attached to my XMC1300 eval board, and I'm trying to change the BMI on a freshly populated XMC1302 device, via the virtual com port on the J-Link and UART BSL (P1.2 & P1.3). I'm using the instructions in the XMC1000 Tooling Guide to no avail.

MemTool fails to connect to the target and I get the following report..

Can anyone tell me what I might be doing wrong?

----------------------------------------------------------

Connection Failed Report from
Infineon Memtool Target Interface, Version: 1.10.9
created: 07/31/13, 14:02:41

----------------------------------------------------------

Windows version:
Win7 (Service Pack 1)
Admin: yes

IMT version:
Release: 4.05.08
Build: 4409
Path: C:\Program Files (x86)\Infineon\Memtool 4.5

Target configuration file:
C:\Users\jml1006\Documents\Infineon\IMT 4.5\Targets\xmc1000_tssop38_evaluationboard_xmc1300_minimon_asc.cfg

Error messages:
MiniMonTargIntf: Can't connect target !
MiniMonTargIntf: Failed to open serial port !
MiniMonTargIntf: Port error: The system cannot find the file specified.



Settings:
PortNum: 0
PortType: COMX
PortSel: JLink CDC UART Port
ReqReset: n
ReqResetMsg:
ResetOnConnect: y
ResetWaitTime: 500
ExecInitCmds: n
ExtStartMode: n
InitScript Script:

BaudRate: 38400
KLineProt: n
UseRS232Drv: y
CanPortNum: 1
MonType: ASC
CheckAckCode: y
AlwaysEINIT: n
UseExtMon: n
MonitorPath:
LoaderStart: 0xFFFFFFFF
LoaderSize: 0x00000000
UseExtMon2: n
Mon2Path:
Mon2Start: 0xFFFFFFFF
SCRMSupport: n
SCRMBaudRate: 0
RSTCON_H: 0x00
S0BRL: -1
UseChangedBaudRate: n
Sv2PLLCON: 0x7103
Sv2ASC0BG: 0xFFFF
Sv2CANBTR: 0xFFFF
TcPllValue: 0x00000000
TcPllValue2: 0x00000000
TcPllValue3: 0x00000000
TcAscBgValue: 0x00000000
TcCanBtrValue: 0x00000000
XC2000ScrmClock: 40000000
XC2000ScrmPllValue:
XC2000ScrmBrgValue:
MaxReadBlockSize: 0
BootPasswd0: 0xFEEDFACE
BootPasswd1: 0xCAFEBEEF
DasDllPath: das_api.dll
DasHost:
DasTryStartSrv: y
DasSrvPath: servers\udas\udas.exe
DasStopSrv: y
DasResetMode: 2
DasRemoveLogFile: n
DasSrvSel: -1
DasPortType: 0
DasPortSel: 0

Info:
ArchType: 5
Architecture: ARM
TcDerivate: 0
IsXC2x: n
IsStm32: n
ExtClock: 64000000
IntClock: 64000000
SysClock: 64000000
PllCalc:
PllValueCount: 1
UsedComPort: 4
CurrBaudRate: 0
CurrMonImage: CortexM.Asc.XMC1000.Def
AscBslAllowed: y
CanBslAllowed: n
ScrmSupport: n
CanScrmSupport: n
AscBslForceKLine: n
CanBslBug: n
TcCanBslMode: 0
Tc1797AscBslBug: n
AurixKlineBug: n
AbmModeDetected: n
0 Likes
Not applicable
I found the issue. The canned configuration setup for the XMC1300 sets the target up for a 64Mhz clock frequency. I changed this clock freq to 16MHz via the Target config->controller tab, and that solved my problem. The Tooling guide specs the baud rates for 8Mhz-32Mhz, so I think the 64Mhz default clock rate was out of spec for setting up the BMI via ACL-BSL.
0 Likes
Not applicable
Upon further review, I needed to only change the baudrate to 19200 while leaving the default 64MHz clock set.

The virtual COM seems to act very unreliably.
0 Likes
Not applicable
I'm using the SEGGER J-LINK LITE debug interface attached to my XMC1200 eval board, and I'm trying to change the BMI on a freshly populated XMC1200 device, via the virtual com port on the J-Link and UART BSL (P1.2 & P1.3).

MemTool fails to connect to the target and I get the following report..

Have any one faced similar issues and any solution for this.

I have tried the following 2 configuration.
64MHZ with 19200 Baud
16MHZ with 19200 Baud

----------------------------------------------------------

Connection Failed Report from
Infineon Memtool Target Interface, Version: 1.10.6
created: 08/16/13, 06:14:16

----------------------------------------------------------

Windows version:
Win7 (Service Pack 1)
Admin: yes

IMT version:
Release: 4.05.05
Build: 4406
Path: C:\Program Files\Infineon\Memtool 4.5

Target configuration file:
C:\Users\marisg\Documents\Infineon\IMT 4.5\Targets\xmc1000_tssop38_evaluationboard_xmc1200_minimon_asc.cfg

Error messages:
MiniMonTargIntf: Can't connect target !
MiniMonTargIntf: Start monitor failed
MiniMonTargIntf: Bootstrap loader not responding !
Please check:
- Target power supply
- Communication cable
- Communication settings

Settings:
PortNum: 0
PortType: COMX
PortSel: COM18
ReqReset: n
ReqResetMsg:
ResetOnConnect: y
ResetWaitTime: 500
ExecInitCmds: n
ExtStartMode: n
InitScript Script:

BaudRate: 19200
KLineProt: n
UseRS232Drv: y
CanPortNum: 1
MonType: ASC
CheckAckCode: y
AlwaysEINIT: n
UseExtMon: n
MonitorPath:
LoaderStart: 0xFFFFFFFF
LoaderSize: 0x00000000
UseExtMon2: n
Mon2Path:
Mon2Start: 0xFFFFFFFF
SCRMSupport: n
SCRMBaudRate: 0
RSTCON_H: 0x00
S0BRL: -1
UseChangedBaudRate: n
Sv2PLLCON: 0x7103
Sv2ASC0BG: 0xFFFF
Sv2CANBTR: 0xFFFF
TcPllValue: 0x00000000
TcPllValue2: 0x00000000
TcPllValue3: 0x00000000
TcAscBgValue: 0x00000000
TcCanBtrValue: 0x00000000
XC2000ScrmClock: 40000000
MaxReadBlockSize: 0
BootPasswd0: 0xFEEDFACE
BootPasswd1: 0xCAFEBEEF
DasDllPath: das_api.dll
DasHost:
DasTryStartSrv: y
DasSrvPath: servers\udas\udas.exe
DasStopSrv: y
DasResetMode: 2
DasRemoveLogFile: n
DasSrvSel: -1
DasPortType: 0
DasPortSel: 0

Info:
ArchType: 5
Architecture: ARM
TcDerivate: 0
IsXC2x: n
IsStm32: n
ExtClock: 64000000
IntClock: 64000000
SysClock: 64000000
PllCalc:
PllValueCount: 1
UsedComPort: 18
CurrBaudRate: 19200
CurrMonImage: CortexM.Asc.XMC1000.Def
AscBslAllowed: y
CanBslAllowed: n
ScrmSupport: n
CanScrmSupport: n
AscBslForceKLine: n
CanBslBug: n
TcCanBslMode: 0
Tc1797AscBslBug: n
AurixKlineBug: n
AbmModeDetected: n
0 Likes
Not applicable
Hi marisg,

Can you try to connect with lower baudrate (i.e. 9600)?
You can change it at Memtool Target -> Setup -> Monitor tab.
0 Likes
Not applicable
Maybe the issue is already solved, but i want to share my experience to anyone having trouble connecting to XMC 1300 BootKit (CPU-13A-V1) via Memtool 4.05.08 Build 4409.
As i understood, BMI of the XMC1302 on the BootKit is set to "User Mode (Debug) SWD0". The only way i could connect to the BootKit so far, was through Minimon/ASC. So i had to change BMI before being able to connect via Memtool.

For me, this procedure worked:
- update SEGGER J-Link with SEGGER J-Link Configurator to "J-Link Lite-XMC4200 Rev.1 compiled Jun 27 2013 19:41:03”
- with DAVE 3.1.8 (not passible with DAVE 3.1.6 !): change BMI from "User Mode (Debug) SWD0" to "ASC Bootstrap Load Mode (ASC_BSL), no debug"
- start Memtool 4.05.08 as administrator (running on Win7 x64)
- press Connect, then unplug and replug the bootkit and press retry (sometimes you have to do this several times and on different USB-Ports of you PC)

If i'm lucky to get a connection, i can disconnect and reconnect and also change the baud rate.
My experience is also that virtual com is quite unstable!
0 Likes
User20557
Level 1
Level 1
Hi all Team,
How can I lock "Read Flash" only. When I reflash new FW by Jlink, I can connect, errase and flash but do not allow reading. Is there mechanism like that?

Thanks!
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked
vietanhbk wrote:
Hi all Team,
How can I lock "Read Flash" only. When I reflash new FW by Jlink, I can connect, errase and flash but do not allow reading. Is there mechanism like that?

Thanks!


Hi,

It is always better to start a new thread in the forum rather than appending a question in an old thread. This will give more attention to your question from the community and keeps the threads issue specific.

Regarding your question, The XMC1100 Flash implements read protection for sector 0 only. Which is used to store system information. To attain your requirement we can set the BMI as User Productive Mode
with “Request BMI installation routine (new BMI)” in the user code. The User Productive Mode(UPM) provides MEMORY PROTECTION by not allowing external tools such as the debugger, access
(read/write) to the Flash memory. Your application software can call this routine to change the BMI value under user-defined conditions, for example via an external interrupt or via GPIO pin latch values.
Pseudo code for this is available inside AP32277 Tooling Guide for XMC1000.

Best Regards,
Vasanth
0 Likes
ipek
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked
Hi,

I want to change BMI of my XMC1400 which is in ASC BSL mode.
Memtool is not a good option for me because there are so many steps and I have to hand over this setup to a person that is not an engineer.
So the procedure shall be as simple as possible.

Is there any other way to do this ?
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked
Hi,

Please check this thread which answers for the above question.

Xmc1400 asl bsl mode details

Best Regards,
Vasanth
0 Likes