- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!,
I have a XMC1400 Boot Kit. I changed the BMI of it from Debug Enabled to ASC BSL(not time-out). (Code block is below)
Then I tried to change it back to debug-enabled with Infineon Memtool. (Because I couldn't find any other way but writing a Memtool-like SW by myself. Is there any ?)
But I failed to do so. Memtool gives error: Bootstrap loader not responding. So I connected an osciloscope and saw that XMC-TX line is not changing. PC-TX line starts to ASC BSL communication but XMC does not send any response. Am I doing something wrong?
Code block:
/*
* main.c
*
* Created on: 2022 Jan 11 15:43:18
*/
#include "xmc_scu.h"
#include "xmc1_scu.h"
int main(void)
{
uint64_t ret = XMC_SCU_GetBMI();
XMC_SCU_SetBMI(XMC_SCU_BMI_HWCFG_ASC_BSL, 0);
while(1);
return ret;
}
Additional information:
- Memtool version: 4.9
- DAVE version: 4.5.0
- Segger JLink version: v7.60b
Attachments:
Error message of memtool
memtool setup
osciloscope screenshot: Yellow(CHannel1): PC-TX, Blue(Channel2): PC-RX(XMC-TX)
Test environment: I am using Jlink plus as debugger. I supply power to the board via the debugger( I checked that, 5V is there) I added two 10K pull-up resistors to PC-RX and PC-TX line. (In un-cracked boot-kit, the xmc4200 debugger part has already got those two pull-ups. But this debugger hasn't so I added.) I checked the connections between debugger and the board. I tried to debug a simple led blink code first and it was fine.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipek,
The problem I found with your code was the while loop after the BMI update will keep the core at that point. So when I removed power and reconnected the device I was able to connect back to the device and change the BMI value. ( I tried the same with Dave Set and Get BMI tool, that also worked). The thought process behind this move was the startup code of the device reads the BMI value and that decides the device behaviour for ASC_BSL. I tried including __NVIC_SystemReset(); in your code for an optimal solution, but that might have bricked my kit now. So I don't recommend on doing that for the time being. I will explore more on that and get back. But with the code you have developed, may be disconnecting and connecting should solve the issue as per my initial observation.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipek,
Happy New Year !
Do resetting board through power-off and power-on board change this behavior ? Are you able to connect then ?
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vasanth,
Happy new year to you too.
Yes of course, multiple times 🙂 In fact I repeat this process with mutliple boot kits and one custom board with an XMC1400 on it and got the same results. We have 4 or 5 garbage boards now 🙂
With our custom boards, (their MCUs came from factory in ASC BSL ) I could easily change the BMI for the first time. But after changing back to ASC BSL with my code, it is dead..
Maybe the problem is this code, what can you say about that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipek,
The problem I found with your code was the while loop after the BMI update will keep the core at that point. So when I removed power and reconnected the device I was able to connect back to the device and change the BMI value. ( I tried the same with Dave Set and Get BMI tool, that also worked). The thought process behind this move was the startup code of the device reads the BMI value and that decides the device behaviour for ASC_BSL. I tried including __NVIC_SystemReset(); in your code for an optimal solution, but that might have bricked my kit now. So I don't recommend on doing that for the time being. I will explore more on that and get back. But with the code you have developed, may be disconnecting and connecting should solve the issue as per my initial observation.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vasanth,
Thanks for your time 🙂
I have tried the same code without that while(1) loop before, but I couldnt recover that board either. In fact I added it because I thought maybe that is the reason my MCUs are keep getting bricked haha.
One of my tries, I added a short led blink sequence before setBmi function, and a infinite led blink after it. I turn the power off and on but I saw no led blinks. May be this would give you an idea about the case?
I am using the latest version of DAVE. I saw somewhere in this forum and in documents that DAVE has a set/get bmi functionality. But mine hasn't, at least I cannot find. Are you using and older version? Where is this bmi functionality in DAVE?
Thanks!
İpek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipek,
You can search for the SetBMI option in the search bar
that will open the tool for you,
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vasanth,
Ok I find it but couldn't make it work.
I tried it with a regular debugable XMC1400 Boot kit, and a brand new XMC1400 MCU on a custom board(in ASC BSL mode) by using JLink Plus. I can connect the one in ASC BSL mode via Memtool and I can debug the other one with DAVE. But this utility doesn't work for me.
It seems like nothing is working properly for me, maybe I have a bigger problem
Best regards,
İpek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ipek,
By default, J-Link changes the BMI from ASC_BSL to SWD0 (P0.14 & P015 used for SWD) if the BMI of the device is ASC_BSL. Is this what happened on your end ? As per link. Even though you have changed the BMI using the code, did the JLINK try to change the BMI mode in your case ? Or did you by any chance change the BMI to SWD1 ? Also you can also try using the on-board jlinker and try changing the BMI mode of the devices.
Best Regards,
Vasanth