Hello there!
I might not be posting this in the right place -- if so, sorry about it.
I am working on a personal project that involves the Wii U gamepad -- basically, making custom firmware and homebrew for it.
The Wii U gamepad employs a microcontroller called UIC, which is a STM8. According to the information I have gathered about it, it would be a STM8L151R8 -- 64KB of FLASH, 4KB of RAM, 2KB of EEPROM, LQFP64 package. The UIC chip on the gamepad motherboard has custom markings ("UIC-WUP") but the pinout matches that of a 'stock' STM8L151R8.
Anyway, I have a gamepad motherboard where the UIC was accidentally bricked.
The UIC has a small bootloader at 0x8000, and the actual firmware (which handles input, power management, and other misc. stuff) is installed at 0x9000. The bootloader simply checks a couple bytes in EEPROM for specific values: if these are set, it jumps to the firmware entry point, otherwise it enters firmware upload mode and waits for a firmware binary to be uploaded. The firmware also has a command that triggers firmware upload mode, to allow for updates.
That's the skinny. What happened to me is that corrupted firmware code was uploaded to the UIC, making it impossible to upload new code the normal way. Thus, the UIC is bricked.
This is where I had the idea of using the SWIM interface to unbrick the UIC. In theory, I would just have to clear the 'firmware installed' marker bytes in EEPROM so I could upload new firmware code. Or maybe I would have to reflash the entire thing, but I have dumps of all the data.
Thing is, I can't get the SWIM interface to respond at all.
From the understanding I have gathered, the memories inside the chip might be locked, but the SWIM interface should atleast respond to activation.
But not even.
My last attempt involved programming a FPGA to send the SWIM entry pulses, and seeing what I get on the scope. In theory, after I send the entry pulses, I should receive a sync pulse after a given amount of time, but I don't receive anything. The STM8 is just not responding at all.
I tried with a pull-up resistor on the SWIM pin, but that made no difference.
I ordered a proper STLink so we'll see if that works, but I don't have a lot of faith there.
So, this has me wondering: can the STM8 (in particular the STM8L151R8) have SWIM completely disabled, to the point it doesn't respond at all? From my understanding of the documentation, that isn't the case, but at this point, I'm doubting... what else could the problem be?