cancel
Showing results for 
Search instead for 
Did you mean: 

Using SWIM and STM8S to send hex file to 24c64wp

MFarl
Associate II

Hi all. 

I am a complete newbie with regard to the world of the STM8 and the programming of it so there are very high odds that I will completely use the wrong terminology in order to express what I think I know and also what I am working to acheive... but I gotta start somewhere so here goes... :)

First off.. circuit architecture and what is in place...

I am using an audio power amp that is used in speaker cabinets and it has a DSP chip in it (Analog Devices ADAU1701) I have been using this chip and programming it for years now but the manufacturer of the amp changed everything and now I am unable to write it to load my own programming.

The previous version of the amp had a direct connection via I2C to the ADAU1701 and it's self-boot e2prom and I was able to program it easily.

With this new version the amp's manufacturer wanted to provide more functionality by installing their own front end to tweak the amp. It is a feature limited version of what I need. They are still using an ADAU1701 and it's e2prom (a 24c64WP) and if I only can use their software then these amps are not usable by me at all unless something else can be figured out.

With this new version, they are using an STM8S105 to do their programming (via SWIM) and then with their programming they are generating the needed hex file to send to the 24c64wp. The ADAU1701 will then self-boot on power up from the 24c64wp.

I have already purchased an ST-LINK so getting to the STM8 shouldn't be an issue... There is a SWIM interface molex on the back of the amp and I have the pinout for that already.

So, my questions are: 

Can I use STVD via SWIM to program the STM8 to send my own hex file to the 24c64wp via the I2C pins on the STM8?

Is there another utility program that will allow this type of operation?

I think there are some utility programs out there that will transfer a hex file but I'd imagine them to transfer to the STM8's internal memory, not external memory... I'd love to be wrong on this.

I have never had to do any type of programming so I am hoping to do this without going that route if possible.

A bonus would be to not disturb any of their programming, which I imagine they are storing in the STM8's e2prom area. 

So to sum it up... I'd like to be able to use a simple utility to, in effect, turn on the STM8's I2C channels so I can slip a hex file through there to the 24c64WP... Hopefully this is making sense. I know it's probably easier said than done and I am likely using the wrong terminology but I needed to start somewhere.

Thanks in advance for any advice or direction that can be provided. I am happy to provide more context or info if needed as well.

Mick

6 REPLIES 6
Karol Merski
Associate II

Hi,

I have few questions:

- does this amplifier has fixed configuration for ADAU or it is configurable?

- do their program has tool for configuration ADAU registers and parameters (filters, etc.)?

- do they provide some hardware for programming the amplifier?

- are you shure they use only SWIM connection, not other pins (uart e.g) (they can use some bootloader to put data to 24c64WP)

These are my thoughts.

The STM8S105 has only 1kB of EEPROM memory, so they do not put the data for ADAU1701 in this area. 

ADAU need about 8kB to store ram parameters and registers.

I think they put this data to flash memory of STM8S105. When STM power up, he is 

checking content of the 24c64WP (whole memory, part of them or only CRC). 

If the data are different the STM8S105 programming it and restart ADAU.

If their program has tools for configuration for ADAU You can:

1. download code from STM8S105 (if it is not protected to read)

2. change the ADAU configuration using their tools

3. programming the STM8S105 by their program.

4. download code from STM8S105 once again

5. compare this two files to find where ADAU data are stored in STM8S105 flash memory

6. manually past your own ADAU code in the hex file and programm STM by SWIM, but 

7. but, I thing, they calculate CRC and write it somewhere in flash (I would do it in their place). You should do the same.

If you are familiar with soldering you can connect to the 24c64WP directly and programming it in this way. 

But if the STM8S105 will check this content he reprogramme the memory if the crc is not valid .

MFarl
Associate II

Hopefully the answers below will help.

- does this amplifier has fixed configuration for ADAU or it is configurable?

The ADAU is configurable

- do their program has tool for configuration ADAU registers and parameters (filters, etc.)?

Yes. It's called SigmaStudio and it is a GUI based tool that is technically a development platform and is rather complicated to use and can also control every aspect of the ADAU and that is the reason the Chinese designers wanted a simple program that limited the purchasers ability to make only changes they wanted to allow. That's a good thing actually in most cases but for me it is too limiting.

- do they provide some hardware for programming the amplifier?

Yes and I have that but it requires direct access to the ADAU1701 and it's self-boot e2prom via I2C. The previous version was setup this way. Now, there is only a SWIM connection and the STM8 sits between the SWIM connection and the ADAU and it's e2prom which is why I can't get to it via my I2C based hardware.

A couple of graphics that may help some.

Here is the old design. It had an 8pin header that I was able to use an adapter to connect to and it allowed SigmaStudio to work directly with the ADAD and also allowed writing to the e2prom to enable self-boot. SigmaStudio generates the e2prom.hex file that is stored in the 24c64wp.

0690X000006C1M0QAK.png

Here is the new design:

0690X000006C1MPQA0.png

They are using an STM8 to generate the hex file that the e2prom requires for the ADAU to self-boot.

The blue indicates what I need to accomplish... use SWIM to open up the I2C ports of the STM8 to transfer the E2Prom.hex file to the 24c64wp.

Hopefully this makes sense given my lack of proper terminology.

Thanks in advance,

Mick

Karol Merski
Associate II

Is there another program between Sigma Studio and SWIM connector? As I know Sigma Studio can connect with other boards by USBi not  ST-LINK and SWIM interface.

MFarl
Associate II

There is a program between that is being used on the STM8 if I am understanding you correctly. You are correct in that SigmaStudio can't connect via SWIM at all but I have another amp I can use with Sigma to generate the hex file I need to send to the 24c64wp.

I put SigmaStudio in the graphic just to show that I'd be using it to create the hex file. Hopefully that wasn't too confusing.

What I am not sure of is if trying to use a utility to write to the 24c64wp via I2C will erase the existing program used by the STM8. If it does that is OK by me but if it doesn't that would be a nice bonus.

I know using SigmaStudio directly via I2c I can run a program for testing and changing parameters and as long as I don't write it there'll be no impact to the existing program. Hopefully that kind of thing can happen with the STM8.

Thanks!

Mick

Karol Merski
Associate II

I understand it like that (image is in attachment)

MFarl
Associate II

Yes, you are correct with regard to the architecture but there are no accessible pins for I2C to the EEPROM so I'll have to find a way to go through the STM8 using SWIM as those are the only pins I have access to.