Update FPGA selftest firmware, fix compilation issues

This commit is contained in:
Renze Nicolai 2022-05-31 22:35:51 +02:00
parent 68da02427c
commit 8e506008d3
5 changed files with 13 additions and 10 deletions

@ -1 +1 @@
Subproject commit 8f74fa692d12566c79adbf36a08d17eb42859d7b
Subproject commit 2882f91df13c6155062b6c94871fdf68e1c62675

View file

@ -10,6 +10,7 @@
#include "ice40.h"
#include "rp2040.h"
#include "fpga_test.h"
#include "pax_gfx.h"
extern const uint8_t fpga_selftest_bin_start[] asm("_binary_fpga_selftest_bin_start");
extern const uint8_t fpga_selftest_bin_end[] asm("_binary_fpga_selftest_bin_end");
@ -17,14 +18,6 @@ extern const uint8_t fpga_selftest_bin_end[] asm("_binary_fpga_selftest_bin_end"
static const char *TAG = "fpga_test";
esp_err_t load_file_into_psram(ICE40* ice40, FILE* fd) {
fseek(fd, 0, SEEK_SET);
const uint8_t write_cmd = 0x02;
uint32_t amount_read;
uint32_t position = 0;
uint8_t* tx_buffer = malloc(SPI_MAX_TRANSFER_SIZE);
if (tx_buffer == NULL) return ESP_FAIL;
/* SPI commands */
#define SPI_CMD_NOP1 0x00
#define SPI_CMD_SOC_MSG 0x10

View file

@ -1,8 +1,13 @@
#pragma once
#include <sdkconfig.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/queue.h>
#include "hardware.h"
#include "rp2040.h"
#include "ili9341.h"
#include "ice40.h"
#include "pax_gfx.h"
void fpga_test(ILI9341* ili9341, ICE40* ice40, xQueueHandle buttonQueue);
void fpga_test(xQueueHandle buttonQueue, ICE40* ice40, pax_buf_t* pax_buffer, ILI9341* ili9341);

View file

@ -18,11 +18,13 @@
#include "fpga_download.h"
#include "hardware.h"
#include "file_browser.h"
#include "fpga_test.h"
typedef enum action {
ACTION_NONE,
ACTION_BACK,
ACTION_FPGA_DL,
ACTION_FPGA_TEST,
ACTION_FILE_BROWSER,
ACTION_FILE_BROWSER_INT,
} menu_dev_action_t;
@ -36,6 +38,7 @@ void render_dev_help(pax_buf_t* pax_buffer) {
void menu_dev(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341) {
menu_t* menu = menu_alloc("Development tools");
menu_insert_item(menu, "FPGA download mode", NULL, (void*) ACTION_FPGA_DL, -1);
menu_insert_item(menu, "FPGA selftest", NULL, (void*) ACTION_FPGA_TEST, -1);
menu_insert_item(menu, "File browser (SD card)", NULL, (void*) ACTION_FILE_BROWSER, -1);
menu_insert_item(menu, "File browser (internal)", NULL, (void*) ACTION_FILE_BROWSER_INT, -1);
@ -90,6 +93,8 @@ void menu_dev(xQueueHandle buttonQueue, pax_buf_t* pax_buffer, ILI9341* ili9341)
if (action != ACTION_NONE) {
if (action == ACTION_FPGA_DL) {
fpga_download(buttonQueue, get_ice40(), pax_buffer, ili9341);
} else if (action == ACTION_FPGA_TEST) {
fpga_test(buttonQueue, get_ice40(), pax_buffer, ili9341);
} else if (action == ACTION_FILE_BROWSER) {
file_browser(buttonQueue, pax_buffer, ili9341, "/sd");
} else if (action == ACTION_FILE_BROWSER_INT) {

Binary file not shown.