Posts by Hardwariano
-
-
Hello again.
I have a problem with JFLASH (V6.84) that was solved some months ago in this other thread.
I want to program the serial number using the file "..._Project_Serial.txt". However, Jflash always asks for "_Project_SNList.txt", as you can see in the attached image.Although I don't use "_Project_SNList.txt", the serial number and the program are correctly saved in memory. The problem is that JFLASH returns ERRORLEVEL = 1, so my batch file fails all the time (see attached image).
Regards
-
Hello Fabian,
I don't know if I'm doing anything wrong, but it's not working. Every time I try to unlock the microcontroller using -setcpuidcode the ID Code verification window appears and I have to unlock it manually.Maybe I didn't understand the functionality of -setcpuidcode and -setrxidcode?
Regarding the issue:
Could you please send us a J-Link log file? How to enable:
wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File
Could you please send us the whole output of the J-Flash log window?Attached are the logs.
Regards.
-
Hello
I want to create a batch file that unlocks one microcontroller before writing , but I'm not sure how to do it.
Reading the manual I saw two options: -setcpuidcode and -setrxidcode. This is what I'm trying to do, but it's not working because JFLASH always shows the id code window:
Code%path_JFLASH_exe% -openprj%path_FILES_JFLASH% -setrxidcode%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX% -startapp -hide -exit
- It's not clear to me after reading the description what the difference is between -setcpuidcode and -setrxidcode.
- Does -setrxidcode go before or after -startapp?
- Does the id code should go between percentage signs?Regards
-
Hi Fabian,
I tried the new version 6.70g and it works fine. I couldn't reproduce the previous issues.
Now, JFlash creates and reads the "...Serial.txt" file well, and the "...SNList.txt" is not requested all the time.Note: the following trick is no longer necessary.
I solved the problem by simply deleting the "..._Serial.txt" file that was previously generated by JFLASH.
It seems that, if present, JFLASH always reads the "..._Serial.txt", regardless of the "Program serial number" checkbox status.Is this the correct behavior of the program? I think that the "..._Serial.txt" file should be ignored if the checkbox status is false.
Thanks for your help.
Regards -
Hi Fabian, no problem, thanks for your response and for your time.
I suppose something was mixed up here?
Since you have a <projectName>_SNList.txt (SN list file) located inside your project folder
This issue persists in the last version V6.71b (see attached image). JFlash always says it can't find "_SNList.txt". That file is not inside my project folder because I don't want to use SNList. I would like to use "_Serial.txt" file, that is created automatically by JFlash because I want to burn consecutive Serial Numbers. Or is "_Serial.txt" no longer used by JFlash in recent versions?
If you want to program the data file without the SN, I suggest you open the original data file without saving the changes.
Ok, I'll do this way.
Regards
-
Hi again
Does this issue still persist with the newest beta release:
The behavior is not exactly the same.
## If I mark the SN checkbox, JFLASH programs the SN well, but it sometimes says that it can't find the "...SNList.txt" (see attached image).## If I don't mark the checkbox, there are 2 possible behaviors:
1) If I never mark the checkbox --> The ".srec" file is not updated with the SN and it is not saved in flash memory, regardless of the "...Serial.txt" file exists or not.2) If I mark the checkbox --> do some SN programming --> deselect the checkbox --> do more programming --> The last serial number is burnt in memory from that moment on.
I noticed that the related loaded ".srec" file memory area was updated whit the SN when when programming the first time. However that area is not cleared when programming the second time (see attached image).I hope I've explained it well.
Regards
EDIT: The same behavior with J-FLASH V6.70.
I've also found another issue: I want to change the next SN from 100 to 150, so I go to the textbox in "options-->project settings-->production-->next SN". Now, I program my device and J-FLASH burns SN=101 instead of 150. I think this is happening because the "...Serial.txt" file has the value 101 previously stored. Does J-FLASH prioritize the file over the project settings?
-
What you could do alternatively is to buy our J-Link SDK:
segger.com/products/debug-prob…nk/technology/j-link-sdk/
It comes with a source project (in C code) of the J-Link Commander (and more) so you could alter it to fit your needs.I'll take a look at it.
Does this answer your questions?
Yes, it's answered so this thread can be closed.
Thanks again for your help.
Regards. -
Hello Fabian
As you can see from the example, save has a very special use case.
Therefore -saveas is the go-to in 99.9% of the cases.It's just what I thought after doing several tests.
Does this answer your question?
Yes, this answers my question.Thanks.
I suggest including the explanation you gave me in the next version of the manual.I have only one more question. Is it possible to store the data read with "-readrange" in a variable to use it in the .bat program? I mean, without saving a new file (with "-saveas") and then reading it manually.
Regards.
-
Hello Fabian.
I solved the problem with "-saveas":
JFlash.exe -openprj%~dp0\SerialNumberDataFlash.jflash -readrange0x40100070,0x40100083 -saveas%~dp0\Data.bin
For some reason I don't know, JFlash didn't recognize "%~dp0", which returns the current path of the .bat file. The solution was simple:
Codeset path_MAIN=%~dp0 JFlash.exe -openprj%~dp0\SerialNumberDataFlash.jflash -readrange0x40100070,0x40100083 -saveas%path_MAIN%Data.bin
It now works well.
Regarding "-save" command I think I misunderstood the way it works . I thought it would record a different ".srec" file, but it actually overwrote the same ".srec" file that had been opened before with "-open" command:
Codeset path_MAIN=%~dp0 JFlash.exe -openprj%path_MAIN%SerialNumberDataFlash.jflash -open%path_MAIN%SerialNumberDataFlash.srec -save REM This overwrites "SerialNumberDataFlash.srec" after opening it
No that I know this, I rewrite muy question: Does "-save" command work if I had not previously opened a ".srec" file with "-open" command? That's to say, If I have only used "-readrange" command to get some data from the microcontroller, as you can see below:
JFlash.exe -openprj%~dp0\SerialNumberDataFlash.jflash -readrange0x40100070,0x40100083 -save
-
Hello Fabian
Then, I uncheck the "Program serial number" checkbox to prevent the serial number from being written this time. But, when I program and read back again, the address 0x40100080 has the value 133 (0x84) again.
I solved the problem by simply deleting the "..._Serial.txt" file that was previously generated by JFLASH.
It seems that, if present, JFLASH always reads the "..._Serial.txt", regardless of the "Program serial number" checkbox status.Is this the correct behavior of the program? I think that the "..._Serial.txt" file should be ignored if the checkbox status is false.
Regards
-
Hi all,
I'm using the command line option readrange to get some data stored in my MCU. It works well and shows the data read as you can see in "readrange.png":
Codecd C:\Program Files (x86)\SEGGER\JLink JFlash.exe -openprj%~dp0\SerialNumberDataFlash.jflash -readrange0x40100070,0x40100083 IF ERRORLEVEL 1 GOTO ERROR :ERROR echo %ERRORLEVEL% ECHO J-Flash ARM: Error! pause
Now, I want to save that data, but it's not working.
- Save command:This code doesn't return error, but it doesn't save the data on my hard drive. How can I tell the code where to store it?
- Saveas command:
CodeJFlash.exe -openprj%~dp0\SerialNumberDataFlash.jflash -readrange0x40100070,0x40100083 -saveas%~dp0\Data.bin
This code returns ERRORLEVEL = 1
What am I doing wrong?
-
As mentioned above, you could do this with a script, so your production would only need to click a .bat or .py file
Yes, you are right, using a .bat file is much easier. At first I didn't think of a ".bat" file, but wrote it on the command line.
- Get current date/time
- Write date/time into a .bin file
- Call J-Flash with the above command lineThis is what I have done and it works. This question is solved.
Thanks for your help.
Best regards. -
Example in a production setup:
JFlash.exe -openprjC:\Projects\Default.jflash -mergeTimeStamp.bin,0x12345678 -auto -exitDoes this solution work for you?
Thanks for the example Fabian. It works well and does what I want. However, I think it's a bit complicated to send it to production because of the need to use command prompt.
Wouldn't there be some way to make an automatic merge without using command prompt? If not, would it be added in future versions?Regards
-
Hello Fabian,
I have attached four files:
1) Log j-flash (Complete process).txt --> It Includes all readings, writings and deletions
2) Log j-link (SN checked).txt --> It only includes the Production Programming (F7) process when Serial Number checkbox y checked.
3) Log j-link (SN unchecked).txt --> It only includes the Production Programming (F7) process when Serial Number checkbox y UNchecked.
4) Serial number data flash.jflash --> j-Flash project fileLog j-link (SN checked).log
Serial number data flash.jflash
Log j-link (SN unchecked).log
Log j-flash (Complete process).log -
Could you please tell us what exactly you are trying to do?
Hello Fabian,
I would like the manufacturer to write automatically the current time and date in the DATA FLASH (using a script with JLINK_MEM_WriteU8(), etc), right next to the serial number (SN) programmed with JFLASH.
Regards.
-
Hello,
Is there a way or function to get the current computer date and time in the "J-link script files"?
Regards.
-
Hello
I'm using SEGGER JFLASH V6.62d, Flasher Portable Plus and a microcontroller from Renesas (S3A6).
When I activate the "Program serial number" checkbox, the serial number 133 (0x84) is written correctly at address 0x40100080. I can verify this by running the command "Read back --> Entire chip".
After that, I perform a complete erasure of the memory with "Erase chip (F4)". The entire memory is written with 0xff, including address 0x40100080.
Then, I uncheck the "Program serial number" checkbox to prevent the serial number from being written this time. But, when I program and read back again, the address 0x40100080 has the value 133 (0x84) again.
Why is this happening?
Regards.
-
-