Page 1 of 1

Command line for prommer

Posted: Wed 2018-03-14 23:45
by YuryShatz
To upgrade kernel or make my custom modifications to it, I use prommer utility in VSIDE.

- It usually worked, sometimes not the first time
- Now it usually says "unable to auto-detect".
- When it does not, often it hangs. Gives a message "Programming the memory! See the stdin/stdout console for details" and then there's nothing in the console. OS does not get updated, the previous version is still there.
- The board is working, it's not bricked, I can run it in USB mode and in regular mode with my program.
- Serial communication works fine in Termite

Even if I can figure it out, I would prefer a command-line tool. Perhaps with some verbose diagnostics.

So there's two questions
- How to tell why the board does not respond to the prommer?
- Is there a command line utility that does the same?

I know there's vs3emu but I can't figure out the command line. It seems to need hardware description file and memory description.

Thank you

Re: Command line for prommer

Posted: Thu 2018-03-15 9:01
by Hannu
Are you booting normally to shell and trying to flash your chip? Execute the vs3emuc on VS1005, so the right serial interrupt is enabled and VS1005 will answer to VS3emu. Disconnect the terminal and write the flash.

It is possible to execute VS3emu from command line.

This command line would give you access through com1. Change -p for that. -x is xtal speed, -s starting speed -ts target speed of communication. 115200 has worked always, higher speed haven't been always so succesful -m memdesc file and -c script file to use.

Code: Select all

vs3emu -p 1 -chip vs1005 -x 12288 -s 115200 -ts 115200 -m mem_desc_debug_all.mem -c runextflash.script
hw_desc file, mem_desc_debug_all.mem and script files can be found from VSOS source code. Available script files:
  • runextflash.script Write to external flash
  • runintflash.script Write to internal flash
  • runvsos.script Run VSOS only through VS3EMU (Don't write anything anywhere)
You'll need to change the load line from the scripts to point your prommer bins. C:/VSIDE/bin/extflash.bin for example. .script files are also in the source code package.

And when you forget this post, take a look inside the .sh files.

Re: Command line for prommer

Posted: Thu 2018-03-15 9:06
by YuryShatz
Oh, thank you Hannu!

I did not realize you could only do that with shell loaded. I tried it with my program and with no program at all.

Re: Command line for prommer

Posted: Fri 2018-03-16 23:43
by YuryShatz
Hannu, thank you once again

I loaded vs3emuc and it works like a charm, both from VSIDE and from command line. From command line it's more reliable at 57600.

For those with the same question, command line for internal flash goes like this:

"C:\Program Files (x86)\VSIDE\bin\vs3emu" -p 6 -chip vs1005 -x 12288 -s 115200 -ts 57600 -m mem_desc_debug_all.mem -c runintflash.script -h hw_desc Emulation-Debug\VSOS_Kernel.coff

(current folder is where your VSOS source code is)

Re: Command line for prommer

Posted: Tue 2019-04-23 1:52
by DavidMc
Hello All,

Based on my searches, this thread appears to be the most applicable to what I am attempting.

Goal: use a Windows batch script (.bat) to load kernel image in to a blank VS1005g during factory programming.
Problem: vs3emu appears to start well, but then hangs.

Note: I am not responsible for writing/compiling the fw, so these tools are not my primary tools. Any help will be appreciated. :)

Here is result of attempting vs3emu.exe

vs3emu.exe -p 9 -chip vs1005 -x 12288 -s 115200 -m mem_desc_debug_all.mem -c runintflash.script
VSEMU 2.2 Dec 19 2017 15:54:36(c)1995-2011 VLSI Solution Oy
Could not read hardware description file, defaults used
Using serial port 9, COM speed 115200
Waiting for a connection to the board...
Sending 0xef
Caused interrupt
Chip version "1005"
Stack pointer 0x3e0, bpTable 0x92e8
User program entry address 0xa959
Usage: load <executable>
At this point it hangs indefinitely, requiring Ctrl-C.

I assume hardware defaults are ok.

My runintflash.script file, modified only to update load line:
y:0xfc02 = 0x2000
y:0xfc03 = 0
y:0xfc04 = 0
y:0xfc05 = 0
load kernel.img
g 0x80
e
Memory file is default.

If I switch to VSIDE Flasher Utility, programming occurs with no problem.
VSIDE is v2.43

Thanks,
David

Re: Command line for prommer

Posted: Tue 2019-04-23 7:47
by Panu
Hi!

I think you are trying to run the wrong binary. In the VSIDE prommer utility, the prommer program (e.g. extflash1005g.bin) is run in the VS1005. That prommer program reads the eeprom image file from the PC and writes it to the flash.

extflash1005g.bin can be run using VS3EMU, no problem. It might even stop the emulator after promming, instead of remaining in console interactive state.

-Panu

Re: Command line for prommer

Posted: Tue 2019-04-23 18:53
by DavidMc
Hi Panu,

Thank you for your reply.

I see now that vs3emu first needs to know flash type, and from there will look for and load eeprom_i.img (we also call it "kernel.img").

Progress, but not there yet. Below, it hangs after it warns of "Can't open map file "eeprom_i.map" for reading", and "Can't open image file "eeprom.img" for reading". The eeprom_i.map and eeprom.img files are in same directory as intflash1005g.bin. I have no idea what are "index register parameters".
VSEMU 2.2 Dec 19 2017 15:54:36(c)1995-2011 VLSI Solution Oy
Could not read hardware description file, defaults used
Using serial port 9, COM speed 115200
Waiting for a connection to the board...
Sending 0xef
Caused interrupt
Chip version "1005"
Stack pointer 0x3e0, bpTable 0x92e8
User program entry address 0x9a7
VSOS_355g_IntFlash\intflash1005g.bin: includes optional header, 31 sections, 1143 symbols
Warning: Index register parameters do not match!
Section 1: startup page:0 start:128 size:3 relocs:2 fixed
Section 2: OpenRescueImage page:0 start:131 size:8 relocs:1
Section 3: ReadRescueImage page:0 start:139 size:33 relocs:3
Section 4: Build32YDowncount page:0 start:172 size:25 relocs:2
Section 5: ReadIFlashStatus page:0 start:197 size:20 relocs:2
Section 6: SetIFlashWriteEnable page:0 start:217 size:21 relocs:2
Section 7: WriteIFlashStatus page:0 start:238 size:19 relocs:2
Section 8: SpiWaitStatus2 page:0 start:257 size:50 relocs:8
Section 9: EraseIFlash page:0 start:307 size:128 relocs:24
Section 10: WriteIFlashPage page:0 start:435 size:112 relocs:26
Section 11: ReadIFlashPage page:0 start:547 size:48 relocs:8
Section 12: DumpFlash page:0 start:595 size:62 relocs:23
Section 13: IsFlashEmpty page:0 start:657 size:61 relocs:18
Section 14: ChipCrc32 page:0 start:718 size:34 relocs:6
Section 15: TestSpeed page:0 start:752 size:316 relocs:75
Section 16: WriteImage page:0 start:1068 size:527 relocs:131
Section 17: ProcessImageMap page:0 start:1595 size:684 relocs:253
Section 18: main page:0 start:2279 size:296 relocs:71
Section 19: const_y page:2 start:1280 size:1394 relocs:0
Section 20: init_x page:1 start:2160 size:16 relocs:3
Section 21: bss_x page:1 start:2176 size:2049 relocs:0
Section 22: bss_y page:2 start:2674 size:4096 relocs:0
Section 23: const_x page:1 start:4225 size:2275 relocs:0
Section 24: FPutc page:0 start:2575 size:15 relocs:1
Section 25: fprintf page:0 start:2590 size:23 relocs:2
Section 26: printf page:0 start:2613 size:23 relocs:2
Section 27: VS_stdiolib page:0 start:2636 size:110 relocs:32
Section 28: OggCrcBlockChained page:0 start:2746 size:40 relocs:3
Section 29: strcmp page:0 start:2786 size:11 relocs:2
Section 30: atoi page:0 start:2797 size:64 relocs:10
Section 31: VS_stdiolib$0 page:0 start:2861 size:24 relocs:5
Starting VS1005g internal SPI Flash prommer v2016-11-03...
Default SPI speed 39.9 Mbit/s
Serial Flash RDID: manufacturer c2 (C2), type 20 (20), density 14 (14)
Serial Flash REMS: c213 (c213)

Can't open map file "eeprom_i.map" for reading
Trying to write RESCUE_IMG + "eeprom.img" instead
Programming file "RESCUE_IMG" (0x0006d0 bytes) to addr 0x000000 (0)
Erasing: .
Program: .
Ok
ERROR! Can't open image file "eeprom.img" for reading, ABORTING!
Finished in 0.89 seconds. Press Close/Cancel on VSIDE
^CTerminate batch job (Y/N)? y
Thoughts?

Thanks!
David

Re: Command line for prommer

Posted: Tue 2019-04-23 20:52
by Panu
copy the eeprom_i.map file from the working vside directory to your directory where you run the prommer.'

Re: Command line for prommer

Posted: Wed 2019-04-24 1:01
by DavidMc
Panu, thank you for your reply.

I copied eeprom_i.map from the VSOS_355g_IntFlash folder (image and map files are here) to the VSIDE\bin folder. Same result.

After more troubleshooting, I moved my .bat script in to the VSOS_355g_IntFlash folder and everything worked. So, you pointed me in the right direction - it was an issue of directory structure.

Thanks!
David

Re: Command line for prommer

Posted: Wed 2020-09-02 1:23
by bayviewboom
DavidMc wrote: Wed 2019-04-24 1:01I moved my .bat script in to the VSOS_355g_IntFlash folder and everything worked.
Hi David,

i'm trying to burn my eeprom without a computer. can you help?

Please reply here:
http://www.vsdsp-forum.com/phpbb/viewto ... =11&t=2594

thx!