Hello,
Is there a way or function to get the current computer date and time in the "J-link script files"?
Regards.
Hello,
Is there a way or function to get the current computer date and time in the "J-link script files"?
Regards.
Hi,
Thank you for your inquiry.
There is no such function available.
Could you please tell us what exactly you are trying to do?
Best regards,
Fabian
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.
Hi,
As already mentioned, this will not be possible via a J-Link Scriptfile.
But you can do this via a J-Flash:
1. Create a .bin file with the desired timestamp via a script (e.g. .bat or .py).
2. When opening J-Flash add the command line "-merge<FILENAME>.bin,<ADDR>" (without quotations).
Example in a production setup:
JFlash.exe -openprjC:\Projects\Default.jflash -mergeTimeStamp.bin,0x12345678 -auto -exit
Does this solution work for you?
Best regards,
Fabian
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
Hi,
Could you elaborate what you mean with "complicated"?
As mentioned above, you could do this with a script, so your production would only need to click a .bat or .py file.
Your bat or py script could do the following:
- Get current date/time
- Write date/time into a .bin file
- Call J-Flash with the above command line
You would only have to set this up once and your solution would be portable and working out of the box.
If not, would it be added in future versions?
This is not planned and there are currently no plans to add this feature, since it is very user and device specific.
Best regards,
Fabian
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 line
This is what I have done and it works. This question is solved.
Thanks for your help.
Best regards.
Hi,
Good to hear, that you are up and running again.
We will consider this thread as closed.
Best regards,
Fabian
Don’t have an account yet? Register yourself now and be a part of our community!