mfgtools
mfgtools copied to clipboard
Empty first line results into successful operation of doing nothing
Hello NXP Team,
I've noticed unexpected behavior, tested with libuuu_1.5.233-0-g79ce7d2 on Windows 11
The UUU file looked like this `
uuu_version 1.5.179
SDPS: boot -f flash_spl.bin
SDPV: delay 1000 SDPV: write -f u-boot-atf-container.img SDPV: jump ` The only reason this file didn't do it's job is because the first line was empty. I believe that this is quite confusing because no one would assume that this is the reason for that behavior. Especially because no error message was created and one does wonder why the device to flash is not doing anything at all.
Thx
Yes, the first line must be uuu_version 1.5.179
Yes, I accept this. But please in the name of grammar and state machines, print an error message. If I stumble on this problem, future developers might have the same problem. T_T
It is used for detecting if it is script or image. If no this line, uuu think it is image file.
It is used for detecting if it is script or image. If no this line, uuu think it is image file.
Or you could look for CR/LF characters, and if you find them, check the next 'line'. Binary files shouldn't be read by 'lines', since there is no such thing outside of the context of a text file.
If the first n bytes of the file are not whitespace, not in the renderable range of ASCII chars and not a Unicode byte marker, then it's probably safe to assume it's a binary image and not a script.
The file extension (and size) are reliable ways to make a guess about what the input is intended to be as well.