totalspectrum / flexprop

Simple GUI for Propeller development (both P1 and P2)
Other
39 stars 15 forks source link

ERROR: EEPROM verify failed on macOS 14.5 and Windows 11 #91

Open k6lcm opened 4 months ago

k6lcm commented 4 months ago

Using the current 6.9.10 and 6.9.9 versions, I am getting the following in the terminal when attempting to flash a P8X32A-D40.

Opening file '/Users/levi/Desktop/Pixelmusic/pixelmusic3000e.binary'            
Stepping down to 460800 baud                                                    
Stepping down to 230400 baud                                                    
Stepping down to 115200 baud                                                    
Using single-stage download                                                     
Downloading file to port /dev/cu.usbserial-P97z9aa5                             
12156 bytes sent                                                                
Verifying RAM                                                                   
Programming EEPROM                                                              
Verifying EEPROM                                                                
ERROR: EEPROM verify failed                                                     
ERROR: Download failed

I have tried running proploader.mac from the macOS command line and I am getting the same issue so I am also creating an issue in the parallaxinc/PropLoader project but that appears to be abandoned since 2020.

Wuerfel21 commented 4 months ago

That looks like a hardware issue, please detail how everything's hooked up.

k6lcm commented 4 months ago

Thanks for responding. Here is the schematic and board layout I am using. It does seem to send some kind of two-way communication with the board as I see data on both TX and RX pins using a scope. But the project itself is not working and I am, of course, suspicious of the error as the culprit.

Pixelmusic3000-schematic PCB

Wuerfel21 commented 4 months ago

Are you showing all the traces on that board? The Propeller has two power inputs, they both need to be connected, otherwise it won't work right.

Wuerfel21 commented 4 months ago

Yeah, the second VDD/VSS pair shows as unconnected in the schematic, too. Fix that first, then try again.

k6lcm commented 4 months ago

Thanks for replying with the suggestion. I checked and there was continuity between those pins already and voltage across them but to be sure, I wired up bodge wires as shown in red. The same issue persists, however. I have quadruple checked the solder joints, too. This is my first propeller project so maybe I have a bad Prop Plug? Not sure. Any other thoughts? 346601490-8752c61f-c1e2-4206-8585-accd09830024

Wuerfel21 commented 4 months ago

There's also a pull-up missing on SCL. I think they're both needed.

Does it work when you just load the program to RAM instead of trying to program the EEPROM?

k6lcm commented 4 months ago

The program does not work in RAM either. What value resistor should I stick on pin 6/SCL? 10k to VCC?

Wuerfel21 commented 4 months ago

Same as SDA, 10k should be fine.

But if it doesn't run in RAM either, there's some deeper issue, likely bad clock source.

I see there's an LED, can you run a simple blink program?

CON
  _clkmode = rcfast
PUB main
  DIRA[16] := 1
  repeat
    OUTA[16] := 1
    waitcnt(cnt+5_000_000)
    OUTA[16] := 0
    waitcnt(cnt+5_000_000)

If that works (with internal oscillator, which is also used during download), try setting _clkmode = xtal1 (crystal direct) and then _clkmode = xtal1 + pll16x (crystal+PLL)

Wuerfel21 commented 4 months ago
k6lcm commented 4 months ago

Ok, checked the crystal with the scope and I am not seeing anything so that is suspect. I just ordered a few more 5MHz crystals. Will swap those in when they arrive and report back.

Wuerfel21 commented 4 months ago

The crytal isn't supposed to do anything before it gets enabled by software. Please do test loading a program with the different clock modes as detailed above.

k6lcm commented 4 months ago

Ah, got it. Your code works (with the addition of setting the frequency using _xinfreq = 5_000_000). The LED is blinking with RCFAST, XTAL and XTAL+PLL. Also, 5MHz clock signal is present on the scope now, as you suspected.

The EEPROM is being written as the program remains persistent after power cycle. So I am at a loss as to why flexprop EEPROM verification is failing and still throwing the message:

Verifying EEPROM                                                                
ERROR: EEPROM verify failed                                                     
ERROR: Download failed 
Wuerfel21 commented 4 months ago

To clarify: You can program the EEPROM fine with a small program but it still errors out in the console, large-er program doesn't work. Correct?

k6lcm commented 4 months ago

Actually, flashing the EEPROM with both the larger project and the smaller LED Blink programs all show the "download failed" error.

Wuerfel21 commented 4 months ago

Sounds like the beginning of the download works, but then it gets corrupted. Try passing -D loader=rom to proploader.

k6lcm commented 4 months ago

Hmm. I changed Commands > Configure Commands > Flash Command to: "%D/bin/proploader.mac" -k -D loader=rom baud-rate=%r %P "%B" -e

No change.

Wuerfel21 commented 4 months ago

Well that's puzzling. Can you try with the official Propeller Tool on winblows?

k6lcm commented 4 months ago

On both Windows 11 and macOS the PropellerIDE throws the same error:

The external program 'bstc' has failed to start.
Verify the executable is in the system path and try again.

Since the official program never seemed to be released in anything more advanced than alpha (v 0.38.5 is the latest version) and has not been updated since 2015, I switched to using flexprop.

Wuerfel21 commented 4 months ago

No, I mean Propeller Tool, this one. https://www.parallax.com/package/propeller-tool-software-for-windows-spin-assembly-2/ Windows only.

(Though idk wtf is even wrong with propIDE there that it can't launch bstc)

Wuerfel21 commented 4 months ago

Update?

k6lcm commented 4 months ago

Haven't had a chance to fiddle with Propeller Tool yet. Will report when I have new data.