engineer

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

cross mob
Jaap_Scheringa
Level 1
Level 1
First reply posted First question asked Welcome!

hello 

How can I protect the Flash with an Segger Jlink ??

How do I add lines into the Batch file, AFTER the Load Command ( HEX ) 

Maybe it's simpel but after several tries I cannot Protect this XMC 1100TO16-0064 Chip

I Use the Command line software with an *.Jlink batch file 

0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

For XMC1000 devices, the flash protection is done by setting the BMI to User Productive Mode. With the BMI set to User Productive Mode, the device will no longer able to access from external either via debug access or boot strap loader. As a result, the device is been protected from flash read and write operation.

In order to recover the device from User Productive Mode, the code to change BMI must be located in the user application before the device is set to User Productive Mode. With the change BMI code available in the device, user can trigger it when they required to recover the device from User Productive Mode. However, no matter what BMI is set, the device will only change to ASC BSL mode when the device in User Productive Mode. And for the security purpose, all data in the flash will be deleted upon changing the BMI from User Productive Mode to ASC BSL.

In the case where user application in the device does not provide the change of BMI code and the device had been set to User Productive Mode, the device will be locked forever and there is no ways to recover anymore!

Meanwhile for unprogammed devices the device BMI is changed using the ASCBSL mode. The BMI is changed to required using a code that is loaded using the following method.  Check this appnote to know more about ASC_BSL appnote.

Best Regards,
Vasanth

View solution in original post

0 Likes
7 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi, 

I hope you wan to protect your flash from further programming. You can see the User productive mode in this documentation. This mode should only be used if the user has confirmed that the code is FULLY TESTED and NO MORE MODIFICATION of code is required. There are SETBMI and GETBMI functions available in segger for you to add to your script.

Best Regards,
Vasanth 

0 Likes
Jaap_Scheringa
Level 1
Level 1
First reply posted First question asked Welcome!

hi Vasnth

Yes the Code is definitif, it's already an approved concept, OK I found the BMI get and SET but that's the GUI version of the Programming. 

Cause I'm an Microchip enginer I'm not so familiar with XMC but want always learn some from this chip device, anyway This is A programm written by my predecessor, he left things undocumented so... Now I'm the one who must find out in some days how It works ..anyway we use the Command line programmer of the SEGGER and use the GETBMI > SETBMI  nut unfortnually the SEGGER returns with -262 ...so ....lot's to do..thank you for fast reply ...  

 

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

Could you try  the following

1. You need to check whether the device is connected properly.

2. Try running Segger software with admin privileges

3. Try XMCFalsher or Dave tools to do the same.

Best Regards,
Vasanth

0 Likes
Hi engineer

Thank you for your reply
One of the issue is I can only Flash with Command Line at this moment, because Segger GUI need a Key to work with , when I want to Flash the XMC.
So I’m looking for the Command structure as, get the BMI > modify this and write back this BMI item ( BMI is mode 0 ) ..
How do I preform this ??? with 32 bit structure do I handle ??

Verzonden vanuit Mail voor Windows
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

"One of the issue is I can only Flash with Command Line at this moment, because Segger GUI need a Key to work with , when I want to Flash the XMC. " -

Could you please clarify this statement. What key do you use ? Could you please let me know what exactly being done ?

Also refer the following device reference manual boot section to understand more about BMI. The boot mode update is done through a dedicated register and when the device is in ASCBSL mode, the additional step is done to bring the device out of the bootload mode to use the SWD interface for further programming. More clarity on what is done on your existing system will help us to understand what is the right solution for you.

Best Regards,
Vasanth

 

0 Likes
Hi Vasanth

At first I’m an Microchip engineer, so With the XMc I’m not so familiar.
With the Key I Ment the Software unlock Key wich is provided by Segger.
But This is an one time issue so The Company does not buy the software Key for the Segger Jlink Flasher.
That’s the Reasom I only can use the Command Line structure of the Segger Jlink Flasher ..

The BMI seems in an area whitch is not accessabe for a ‘Normal’ Use.
In the Window Version of the Segger Flasher you could program an afterwhile set the Protect bit ( probably the BMI )
But Unfortnalty I cannot use the Windows flasher of the Segger as reason we do not buy a softwareKey for this one time project.
I refer the Manual but cannot see anything about the BMI settings in Command stucture mode .. as use with GetBMI and SETBMI ( the BMI is now 2 )

The only thing we have is an existing *.HEX file wich we burn into an XMC chip, but for nu the Flash field is readable with an Segger Jlink Base/.
So tyhat’s we want to protect our *.hex file after the Burn into the Chip and Protect it for reading by other persons.

Verzonden vanuit Mail voor Windows
0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

For XMC1000 devices, the flash protection is done by setting the BMI to User Productive Mode. With the BMI set to User Productive Mode, the device will no longer able to access from external either via debug access or boot strap loader. As a result, the device is been protected from flash read and write operation.

In order to recover the device from User Productive Mode, the code to change BMI must be located in the user application before the device is set to User Productive Mode. With the change BMI code available in the device, user can trigger it when they required to recover the device from User Productive Mode. However, no matter what BMI is set, the device will only change to ASC BSL mode when the device in User Productive Mode. And for the security purpose, all data in the flash will be deleted upon changing the BMI from User Productive Mode to ASC BSL.

In the case where user application in the device does not provide the change of BMI code and the device had been set to User Productive Mode, the device will be locked forever and there is no ways to recover anymore!

Meanwhile for unprogammed devices the device BMI is changed using the ASCBSL mode. The BMI is changed to required using a code that is loaded using the following method.  Check this appnote to know more about ASC_BSL appnote.

Best Regards,
Vasanth

0 Likes