LoadP2 errors with custom board
Rayman
Posts: 14,646
in Propeller 2
I finally got a P2 board where everything looks right, but noticed errors on load about 25% or so of the time using LoadP2.
I don't seem to get any errors with the Prop Tool.
I'm pretty sure it's because of the way I'm using the FT231X... I have it with 5V I/O and using 10k resistors on TX & RX (see attached).
Maybe I can fix this by swapping for 1k resistors.
But, if it works with the Prop Tool 100%, maybe I could argue that something is wrong with LoadP2?
I don't seem to get any errors with the Prop Tool.
I'm pretty sure it's because of the way I'm using the FT231X... I have it with 5V I/O and using 10k resistors on TX & RX (see attached).
Maybe I can fix this by swapping for 1k resistors.
But, if it works with the Prop Tool 100%, maybe I could argue that something is wrong with LoadP2?
Comments
ERROR: timeout waiting for initial checksum: got -1
ERROR: bad checksum, expected 50 got ffffffd0 (chksum characters EÀ )
But, switching my 10k resistor array to a 1k array seems to have fixed it.
This also switches the RESn pullup from 10k to 1k, same for the pull-down on the 2N3904 in the reset circuit.
But, all seems to be OK.
Problem solved, I guess.
I'd bridge those out for a direct path. Then you can go back to having the 10k pull-ups. Bad idea - see below.
the FTDI TX resistor can be lowered but can be as is
the problem is FTDI RX (or P2 TX) resistor. This can be completely removed or replaced with a very low value
PS: I now understand these are like this to allow powering either side separately without the protection diodes causing power up of the other side.
This may be a relic from my old FT232R circuit and maybe this issue is fixed in the new chip.
But, I think I'll just leave it with the 1k resistors.
Removes any chance of pin contention issues with bad code...
It can be 5V or 3.3V, I believe.
Wait, I'm wrong about that, that was for FT232R....
Uh Oh! Just realized I shouldn't be putting 5V on VCCIO with this chip!
Guess I need another revision...
The EFM8UB3 that I use looks after reset without the need for external circuits and also floats the TX to the P2 if USB is not connected. Of course it does way more than all that and the firmware can be loaded from the PC over USB.
They actually when the opposite way with FT231X: Instead of 5V or 3.3V, the I/O voltage options are 3.3V or 1.8V...
I have had it working up to 8Mbd and it has been customized for the P2D2 and the P2 in general. When it detects the serial loader "pulse" internally it will not only generate a perfectly timed P2 reset pulse, but it will also pullup P59 which tells the P2 to ignore the SD and Flash and just load serially. This saves having to disable any bootable media. There's also a reset input for external reset and reset button. If the input is held longer than 1 second it will force it into the serial load mode which is handy for entering the debugging and TAQOZ in ROM. The reset input is also an output so any chips that require or could benefit from a reset can just connect to this.
You can integrate the blank QFN or QSOP24 version and simply load the firmware into the chip via USB the first time you power-up after it has been assembled. I have an 8051 assembly source code version of it that you can customize easily using asem-51, so there is no need for any "tooling". The QFN version has the exact same pinout as the CP2102N btw which is what this device appears as to the PC.
If you use the optional I2C bus you can talk to the chip and change the IDs and options etc from the P2. The state of the P2 reset can also be configured since my default is to have a pulldown on the P2 reset and let the UB3 enable the P2 when power is good and stable, which is also effective as a brown-out and I also incorporate a watchdog. But to use it effectively, you should power this chip from the P2's 3.3V supply which is what I do even with my old FT232 designs and I never have a problem with phantom power.
BTW, it's way cheaper than a slow and boring FT232
I should also mention that I get the UB3 to switch the supply to the SD card as well which is necessary sometimes as the card can be stuck in an uncertain state.
The FT232 and CP2102 drivers seem to be included with any computer I use, even phones and tablets. Certainly works with Linux, WIn10, and even WinXP etc.
I read the question as about the 8051 uC you're using rather than CP2102/FT232. Or are you saying the same driver works for the UB3 as well?
Yes, absolutely. This is the dmesg output on unplug/plug event. I can even change these descriptors over I2C with commands from the P2.
Dumping the Flash area where this is all stored:
Win10 and Linux vary in what parts of the USB info they decide to make visible, but the firmware release version number looks to be visible in both. Currently that is 2.5.7
The Silicon LaBS you see in Peter's report above, is a deliberate case-flip to see what is visible. Linux shows that, but Win10 does not)
UB3 is coded to also echo DTR and RTS back, so you can confirm it is a UB3 with that simple test.
There is a PC-side driver update due from SiLabs 'soon'? to address some of the issues I found.
In their current release, their SW artificially limits baud settings, you need to enter a low 'baud' value of 2..24, which UB3 handles as 24M/N
Few month ago I buy a new notebook, for the reason because my old netbook had a very small screen, not ideal for programming.
First I test the new one with all possible usb - devices, also with the P1 - demo board.
With all this devices I got no problems.
But with the P2 Eval board, after a second the green ON - LED turned off and the blue ACT LED turned on.
loadp2 say "Device not found".
The same if I support the Board with AUX - USB and use the "normal" USB just for communication.
Steady State is I program on notebook and sent the binary via homenet to the old netbook. After a while you got used to it.
I think the new notebook is not to blame and neither is loadp2.
Prozessor Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Hauptspeicher 7856MB (1587MB used)
Maschinen-Typ Notebook
Betriebssystem Ubuntu 18.04.4 LTS
Benutzername reinhard (Reinhard)
Date/Time Mo 20 Jul 2020 19:38:03 CEST
USB-Geräte
Linux Foundation 3.0 root hub
Acer, Inc
*** Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO) <---- P2 Eval board detected ***
Cherry GmbH SmartBoard XX44
Intel Corp.
Logitech, Inc. LX3 Optical Mouse
Linux Foundation 2.0 root hub
I renamed it to loadp2.py. The good thing about a python loader is that you can tweak it to suit very easily. Use Python3 as your default Python.
Part of the load problem seems to be the simple one capacitor reset circuit I think.
btw, try lsusb and lspci for specific information about devices, and then play with these commands for even more detailed info.
console output
Python code (slightly modified)
Thank you, I think the info above is for me.
more detailed info . . .
But it looks more like an electronical problem, maybe you can see on the picture the green PC USB ON LED is off and the ACT LED is on. This is not the normal behaviour.