How can I program an XHRA 2HPA

Technical questions regarding the XTC tools and programming with XMOS.
geralagunes
New User
Posts: 2
Joined: Thu Aug 24, 2017 1:52 am

How can I program an XHRA 2HPA

Post by geralagunes »

Good night everybody. I have a question. How can I program an XHRA 2HPA. I have this microcontroller, but don't know the process for send a program from my computer. I don't have experience with these devices, is necesary a programmer? or only need do the conections with a USB conector (similar to the evaluation board)? Thank's.


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hello and welcome. There are many posts on this subject in the forum but the summary is:

1) The XHRA 2HPA is a fixed function device with factory ROM (OTP) code that demands that a pre-programmed flash device be applied onto your PCB.

2) This pre-programmed flash device must have QSPI bit enabled. This is important as the ROM (OTP) code requires this to boot.

3) The external QSPI flash can be programmed by many methods including:

a) external programmer for this memory device (your choice but be sure it supports QSPI settings)
b) in-system programming but only by using external pogo pins while the CPU is in RESET so the QSPI lines from the CPU are hi-z (tri-state)
c) use a modified StartKit to program this memory device - we have done this in the lab by mating a SOIC breakout board -> solder on your QSPI flash memory device -> mate this small PCB to the free port pins on the StartKit -> run the SPI progamming code to program this target device using standard SPI commands. Startkit is about $ 15 USD from Digikey + SOIC breakout board ($2-$3 USD).

The XMOS xflash tool can be used to make the StartKit appear like a flash programmer -> you will need to define the port pins that will be used for this programming exercise. Just keep in mind that XMOS CPU devices are essentially very fast GPIO port pins. By modding the xflash XN file, you can morph the StartKit to be your programmer.


You can find the dump of the flash memory here:

http://www.xcore.com/viewtopic.php?f=26&t=6011

Write back if you any questions. Good luck!
geralagunes
New User
Posts: 2
Joined: Thu Aug 24, 2017 1:52 am

Post by geralagunes »

Ok. I have the quad spi flash (IS25LQ016B). I go to use the TI866cs programmer, that support this memory (with the software MiniProV660). What need to charge to the memory?
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

1) Program the SPI flash using the posted firmware.

2) Enable the QSPI bit on this SPI flash.

3) Solder onto your PCB to test.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

see here


Image
dutcher
Member
Posts: 15
Joined: Wed Oct 18, 2017 1:38 pm

Post by dutcher »

Heyy, I the same problem, do I need to program the XHRA-2HPA or is this preprogrammed in the factory?

I want to use the IS25LQ016B as serial flash memory. I want to program this with a USB SPI flash programmer from aliexpress. (https://nl.aliexpress.com/item/New-Arri ... 0.0.EoU9LX)

now I wonder if I can use this programmer for the IS25LQ016B.
What commands do I need to program? I don't really understand the function of those 2 chips (XHRA-2HPA and the IS25LQ016B).

see attachment for the schematics.

hopefully someone can help me out.
(topic starter, sorry I don't have an answer for you)
Attachments
4.jpeg
(95.62 KiB) Not downloaded yet
4.jpeg
(95.62 KiB) Not downloaded yet
Lucas
Member
Posts: 10
Joined: Tue Nov 05, 2013 10:14 pm

Post by Lucas »

I'm trying to figure this out as well. My background is mainly analog circuitry so this kind of stuff is very unfamiliar. There is a lot of information in this forum but is scattered so it's going pretty slow.
Based on threads and posts I have come across, mon2 is a huge source of info and help.

I am using xCORE-AUDIO Hi-Res DAC/HPA Platform as a reference design. On that page it looks like the flash firmware and usb driver is available for download. I say "looks like" because I have not verified them myself.

Section 6.3 in the XHRA 2HPA data sheet specifies QSPI flash and explains why and how to program.

From what I have read the QSPI flash chip can be programmed in-circuit as long as the XHRA-2HPA is held in reset while programming (thank you mon2). PCB needs to be designed for programmer access.
The flash chip can also be programmed before being soldered to PCB but is a challenge because it is SMD.
Another option is to get flash chip already programmed from the distributor but really only makes sense for production quantity.

My questions are along the same lines as this thread title - HOW to program?
Only requirements for programmer is that it can program QSPI flash chips and can transfer LSB first.
What programmers are you using? Is there a preferred or recommended programmer?
I have seen the Startkit mentioned quite a bit (I am trying to get more info about).
What about the XTAG programmer?
Can xTIME Composer be used to program?

This seems like the perfect thread to consolidate information that is scattered throughout the forum...

Lucas
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi @Lucas.

1) True that the QSPI flash must be programmed out of circuit before soldering onto your PCB. Agree it is a pain but we recall one of the developers @ XMOS noting that there was not enough room for the OTP code space to permit programming of a blank device so it is what it is.

2) It is a valid idea to park the XMOS CPU into RESET so that the QSPI pins will tri-state -> then you can assert external signals to program a blank soldered device using pogo pins or similar. Just returned from HK and met with a number of very capable pogo pin suppliers. If there is an interest, can post their details here. One of the vendors offers a magnetic pair of fixtures that are in use for some medical devices. Very impressive on the connect force which suspect could be used for this application. Summary of the vendors is to make use of something off the shelf so you are not paying for custom tooling. Best to ride on their volume run components. Of course they had the Apple magjack style connectors as well for power supply use.

3) When we reviewed this requirement about a year or so ago, we took a standard XMOS Startkit and wired up the spare port pins to act like a SPI interface flash programmer. Using standard SPI commands, it is 100% possible to upload the firmware into the blank target and then can enable the QSPI bit inside the flash device. Being standard SPI commands and not QSPI commands, the process is quite slow and recall it took about 7 mins but we did not invest time to improve this benchmark.

Another option using the Startkit is to simply hot air remove the supplied flash device from XMOS and solder in your blank. Perhaps the factory soldered device is also suitable for your IP so you may not have to replace the flash component. Then just use the xflash tool from XMOS to perform the same task. Keep in mind that XMOS is bit banging demon so you can repurpose the pins for GPIO or in this case, SPI programmer.

With some effort, the same SPI IP could be improved to FIRST enable QSPI mode and then QSPI bit bang out the same programming but will do so with 4 bits per clock cycle so will be faster. This improvement including a zero force socket slice board (which we have sourced the bare PCB but not yet assembled) is on our pile of projects to close. It is just that we need to focus on the real revenue widgets before our products become stale. China Inc. has everything and cheap but we see many areas of improvement. Did meet with a vendor in HK that was using XMOS (and audio tube amps, etc.) but he was quite reserved to chat. We are not an audio developer so this was just a quick hello introduction. Oh the irony of talking tech with a western company in China :)

4) The other option is of course to source a low cost USB based programmer as noted above in this thread. Do the same thing but for production, not going to happen.

For example, the TI866cs.

In a quick summary - the external flash must be programmed correctly, in the proper low / high byte sequence AND the QSPI bit enabled. If not, this XMOS CPU will not boot your firmware!!

In yet another thread, we posted the proper format that worked for us for programming. Just clone our dump we posted and you will be fine. Somewhere in the lab, we have the (slow) standard SPI commands that erase -> program in standard SPI mode -> then enable the QSPI bit. After this process, we confirmed our programmed flash worked fine in the official XMOS ref design.

BTW - if you use a XCORE-200 based kit, the XFLASH tool will program the target flash device using QSPI mode !! That is a bonus for having the new CPU device but is a more costly investment. We just wrote our own code because at the time, we could not decipher how to use XFLASH in QSPI mode.

In our pending release of the FLASH SLICE board, we have onboard header pins so you could mate to pogo pins and use a programmer in production. If someone is really anxious, we could prepare a kit (not assembled at this time) to experiment. Often we sell our XMOS goods at fair / low cost to encourage other developers. We do plan to sell the product assembled but need some quality time to close the product.

Another idea is to consider one of the assembled cables from this company (we no relation with them):

http://www.tag-connect.com/

and repurpose for your task of QSPI programming while keeping the XMOS CPU in park mode (ie. RESET). Of course you will need to plan for the use of this cable and respective footprints on your end widget.

Hope this helps and will raise some of your confidence to proceed forward. Post back if something is not clear.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Just had a flash back (no pun) that the XFLASH tool was taking longer to program the SPI flash device than our own coding. Believe it was due to page erasing before writing as compared to chip erase and then just flashing the device. Have the SPI logs somewhere using the Beagle tools...
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Here is the thread that offers the details of the proper low & high byte format for the flash device:

see page 5

http://www.xcore.com/viewtopic.php?f=7& ... h&start=40
Post Reply