Can I download a stand-alone firmware image over the co-processor interface?

Question: Can I download a stand-alone firmware image over the co-processor interface?



Yes! In matter of fact the CY4640 version 1.1 and greater have enabled this feature and can be used for reference. To understand how this is implemented by Cypress you first need to understand how scan signatures and scan codes are used by the BIOS. The standard process when building stand-alone code is to compile the code and then run the scanwrap or scanwrp2 programs, which embed scan signatures and scan codes in the firmware image. These scan signatures/codes can perform functions like write to a register, write to regular memory locations and start the execution of code. More information on scan signatures and scan codes can be found in the BIOS User Manual (Section 1.7.2) included in the Docs directory after the CY3663 or CY4640 software has been installed on your computer. Once a scanwrapped image is available an application can parse through this image and do the same thing that the BIOS would do with these scan codes except it can do this over the co-processor interface using LCP commands. For example one of the first things in a scan wrapped image might be to change the wait states for the external memory. If you were to look at the scan wrapped image with a HEX editor you would see:

B6 C3 03 00 09 3A 22 22  (Note the byte swap for the little endian)

C3 B6 - is the scan signature
00 03 - is the length after the OpCode
09 - is the OpCode for Write Configuration
3A - is the configuration address (adds 0xC000 because this is the configuration space)
22 22 - is the data that will be written to address 0xC03A.

So the parsing routine would recognize the scan signature as being valid and would know how long the actual data is going to be. It will then recognize that this is to write a configuration register and has the register address and data that needs to be written. Then over the co-processor interface it will use the equivalent LCP command. In this case it would equate to a COMM_WRITE_CTRL_REG LCP command. The application can then continue parsing through the scan wrapped image until it has downloaded the complete image and started execution of the code at the starting location of the firmware image.

Check the Cypress web site for updated application notes that address this topic in more detail.