I'm trying to program the spartan board for my gbahd and I got to the point that the right board and com port is selected in the arduino ide but I run the test code shown here; https://github.com/zwenergy/spartan-edge-esp32-boot and I am getting the attached error
#problems programming spartan board for programming gba hd
1 messages · Page 1 of 1 (latest)
Please remember to provide as much information as possible including all troubleshooting steps you have already taken. If this is a hardware issue, please provide clear in-focus images of the issue, PCB (circuit board), installation, and any soldering you have done. Help us help you, posts with insufficient information will be deleted
also the switch under the tape is flicked on
I see you're working out of your one-drive directory. Do you have all the files actually loaded and on your PC?
Did you add the ESP32 libraries to the Arduino IDE and set the board/processor?
Yup, it's set as "DOIT ESP32 DEVKIT V1"
What is that sketch you're trying to compile?
Ah I see now the link
Yeah it seems like what it wants to do is a reference a file but I don't have said file and that's messing it up? But I have no idea what said file is or exactly how the syntax works
Just go on and try the actual boot program
Choose the "01LoadDefaultBitstream" example
alright, is the serial monitor the same as the serial console because I cannot find a place to open it up in
yes it is
Where are you at?
I googled it and they must've renamed it or something, I'm on step 3, I held down the boot button for a second or two and instead of a mount error I got this error;
Huh, seems actually somewhat logic. Try to replace "main" in line 36 and 48 by, e.g., "mainPage"
looks like line 48 was already that, do I have to change the parentheses?
Euh, sorry, I didn't see that. Then no, change line 36 main to "mainC" and in line 48 main to "mainC" (but leave the mainPage)
you're good and does this seem correct? I think it does but I don't trust myself with any software
it seems like a fancy way to say the mount failed
Compilation seems to go through, but it doesn't flash the ESP32
could it be since I'm holding the boot button before uploading instead of quick presssing it? thats what I thought the wording here meant "3.5 Press 'BOOT' Button on Sparton Board and last more than 1 seconds to force ESP32 enter Bootloader mode."
Try to push and hold the "boot" button, click upload and wait until it says "connecting" in the serial monitor, then release the boot button
seems to have worked, it says it is writing now
👍
the ide seems to be stuck here and the fpga done light is flashing on and off, should I hit the reset the button or wait to see if something happens
I don't think I do? I didn't check beforehand. Is it supposed to be something specific?
There should be a Wifi called "gbaHD"
Definitely don't see it then
Or try resetting the board
I'm not sure the resetting is doing anything, it just freezes whichever one of these lights is solid when I press it
Did place an SD card already in the board?
Yeah, I thought I was supposed to have the SD card with overlay/default.bit in it when I ran the code in the ide
Yeah, that's good. Hm.
I could force quit the ide and then hit reset to see if that changes things, it could just be stuck trying to remove itself when it cant
Instead of giving up on removing itself
Did you format the SD card with FAT32?
Hmm, never seen that. I would guess that something with loading the bitstream goes wrong. I'd double check the folder structure, naming and the actual bitstream file
The only things I have on the SD card are the overlay folder and default.bit and both are spelt correctly, there isn't anything else I would need in there right
its still doing the flickering back and forth after I unplugged it and it plugged it into a usb port with no data so it isn't a weird terminal interaction
I tried just doing it again and same exact issue
Add printf( "Booted!\n" ); to line 91 of the loadDefaultBitstream example, flash the ESP32, connect the serial monitor (, potentially reset) and see if you can see the "Booted" message there
got a new error
Also here is how I added to code
c:/users/LiamS/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: BFD (crosstool-NG esp-2021r2-patch5) 2.35.1.20201223 assertion fail /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/binutils/bfd/elf32-xtensa.c:5012
collect2.exe: error: ld returned 5 exit status
exit status 1
Compilation error: exit status 1
actually could it possibly be my "flash frequency" its set to 80mhz but also has an option for 40
the baud is set to 115200
Hm, then replace it with Serial.print( "Booted\n" );
looking at it, it won't compile now even without adding that line of code, I'll try rebooting my computer
the serial monitor is printing out booted
but it is printing out booted every single time the lights flash which they are still doing
Does it also write something about card mount failed?
doesn't look like it
This is what is repeated every flash
ELF file SHA256: 269122e7f9017ab0
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
Booted
FPGA Configuration success
abort() was called at PC 0x40150052 on core 1
Backtrace: 0x4008369d:0x3ffcaf00 0x4008ce85:0x3ffcaf20 0x40092a71:0x3ffcaf40 0x40150052:0x3ffcafc0 0x400d8e21:0x3ffcb060 0x400d2b51:0x3ffcb4a0 0x400daaa6:0x3ffcb510
Huh, it seem that it fails somewhere during WiFi setup
Then try to replace the whole loadDefaultBitstream example with the content of this version
https://github.com/zwenergy/spartan-edge-esp32-boot/blob/51347e9db6a47e1e0857b164c6d0acfd8f278c4e/examples/01LoadDefaultBitstream/01LoadDefaultBitstream.ino
It doesn't involve Wifi yet
rip
ELF file SHA256: 809a8f7905a30c56
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
FPGA Configuration success
abort() was called at PC 0x400ecfb6 on core 1
Backtrace: 0x40083569:0x3ffc4f70 0x40089925:0x3ffc4f90 0x4008ef8d:0x3ffc4fb0 0x400ecfb6:0x3ffc5030 0x400d1d91:0x3ffc50d0 0x400d1ade:0x3ffc5510 0x400d415a:0x3ffc5530
all the homies hate core 1
Hm, that's very interesting. It's crashing immediately after successfully loading the FPGA. Looking at the code, there isn't really anything to crash.
A shot in the dark: Open the file "src/spartan-edge-esp32-boot.cpp" (it should be now in the library folder, see here https://docs.arduino.cc/hacking/software/Libraries ). Add the following line to line 122:
return 0;
I'll try that tomorrow, I'm saving my energy today cause I'm hanging with friends later
@shy fjord I opened that file in the ide but then all it did was open
#include <ESP32IniFile.h>
#include <spartan-edge-esp32-boot.h>
/*
- 01LoadDefaultBitstream
- loading the default Bitstream
- The MIT License (MIT)
- Copyright (C) 2019 Seeed Technology Co.,Ltd.
*/
// include the library:
#include <spartan-edge-esp32-boot.h>
// initialize the spartan_edge_esp32_boot library
spartan_edge_esp32_boot esp32Cla;
// the bitstream name which we loading
#define LOADING_DEFAULT_FIEE "/overlay/default.bit"
// the setup routine runs once when you press reset:
void setup() {
// initialization
esp32Cla.begin();
// XFPGA pin Initialize
esp32Cla.xfpgaGPIOInit();
// loading the bitstream
esp32Cla.xlibsSstream(LOADING_DEFAULT_FIEE);
}
// the loop routine runs over and over again forever:
void loop() {
Serial.println("run");
delay(3000);
}
which is just 01loaddefaultbitstream
Try open the file in a regular text editor
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
E (63) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (64) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
Card Mount Failed,please reboot the board
ets Jun 8 2016 00:22:57
that is showing up many many times
and the error is very large, but is a compliation error exit 1
its connecting to the wrong com port, is there a way I can change that?
what com port is your spartan on?
just reran it and it chose rught
holy shit. I think it worked. first time I can flip the switch back for like a week it feels like
you most likely had the wrong version of the esp32 board library
my guess is that you can't go above version 1.0.6
Dang, that stinks that the issue was so simple, is there something I need to do for it to actually send the video signal when I turn it on? It seems like it isn't supplying power to the sp, when I flip the switch on the spartan board the power light flashes for a second then shuts off
what does the arduino serial monitor say?
shoot, this
rst:0x10 (RTCWDT_RTC_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
is your sd card formatted properly?
fat 32 overlay folder with default.bit in the overlay folder
I'll do one more sanity check that I didn't miss a typo in the names
after I put the sd back into the board I click reset and it is sucessfully done, the wifi is showing up
I can't find what to do with the wifi or how to use that function on the gbaHD GitHub, is there another repository I have to go to?
if you put the bitstream on the sd card you don't have to worry about the wifi part
Hmmm I'm still getting no power to the sp it seems, you can see it the blue flash but then it stops supplying power
Alright thanks