erasing fxcore programs how to

Post Reply
HKWijhe
Posts: 16
Joined: Wed Nov 16, 2022 4:27 am

erasing fxcore programs how to

Post by HKWijhe »

I would like to erase the fxcore programs to start with a clean sheet. Is that possible by a simple (undocumented) I2C command or do I need to re-program the fxcore slots one by one with only FF's as data? How does the program slot status detects if a slot is programmed or not?
stanleyfx
Posts: 42
Joined: Fri Jan 27, 2017 2:19 pm

Re: erasing fxcore programs how to

Post by stanleyfx »

I'm not sure what the benefit of erasing all programs would be, if you want to start from a clean sheet why not just write a 'straight through' program so that all 4 inputs are passed directly to all 4 outputs and write this to all 16 locations. Unless you have a special reason to erase all memory locations of course.
Mick (Blue Nebula Design team)
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: erasing fxcore programs how to

Post by Frank »

If you did this the chip will detect all program locations as 'bad" and go into a special state that assumes it has just come off the production line and is at test. From your perspective it will appear to lock up and you cannot do anything to it.

The FXCore saves a checksum with each program so you do need to write a program and the expected checksum (all done in the assembler as part of the write process) and the chip will save the checksum. When the FXCore is powered up it calculates the checksum for each program and compares it to the expected one, if they do not match the chips assumes a FLASH error in that program location and marks it as bad.

Just write a pass program as suggested or a "do nothing" program to all locations, something as simple as "cpy_cc acc32, acc32".

You could write a batch/shell script to just quickly call the assembler to write the program to all locations for you. The assembler is a command line program for this type of thing, people use batch scripts in their production lines as they do not need a GUI or editor in production.

If you cd into the location of the assembler (C:\Program Files\Experimental Noize\FXCore is the default location) and run the assembler at the command line with the -h option like:
C:\Program Files\Experimental Noize\FXCore>fxcoreasm.exe -h

It will show all the options it accepts:

C:\Program Files\Experimental Noize\FXCore>fxcorecmdasm.exe -h
FXCore Command Line Assembler 2.4.2.0 Help
Usage: FXCoreCmdAsm.exe [Options] filename
-h : Print usage info and exit
-a : Assemble to HEX file
-c size_pre reg_pro_pre: Write C array file, option MUST be followed with the strings to prepen to the size and registers/program arrays
-r : Assemble and run from RAM, requires FXCore dev board or ICP, may not be used with -re, -p or -x
-re : Assemble start run from RAM and exit leaving FXCore in run from RAM, requires FXCore dev board or ICP, may not be used with -r, -p or -x
-ee : Exit run from RAM after leaving FXCore in run from RAM, requires FXCore dev board or ICP, accepts -i other options ignored
-p n : Assemble and program location n, n=0 to 15, requires FXCore dev board or ICP, may not be used with -r, -re or -x
-i hex_num : Set I2C address of target to hex_num, MUST have leading 0x. 0x30 is default
-x n : Program an assembled HEX file to location n, n=0 to 15, requires FXCore dev board or ICP, may not be used with -r, -re or -p
-s : Print serial number and exit
After assembly the assembler will write a .lst file showing assembled code or assembly errors encountered.
Example: FXCoreCmdAsm.exe -a -c u16 u16 my_prg.fxc
This program relies on the HIDSharp library released under the Apache open source license.
HKWijhe
Posts: 16
Joined: Wed Nov 16, 2022 4:27 am

Re: erasing fxcore programs how to

Post by HKWijhe »

Sorry for my late reaction (the flew + busy times just before X-MAS):

Thanks for your reply, very helpful for me.

I wish you all a relaxing Holiday period !!
Post Reply