Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
!lua_build.sh
!merged_stream.sh
!patch_esp_efuse_startup.sh
!patch_esp_spi_flash_hpm.sh
!patch_esp_trace_include.sh
!pico_build.sh
!pre_commit.sh
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ RUN ./patch_esp_efuse_startup.sh
COPY ./patch_esp_trace_include.sh /
RUN ./patch_esp_trace_include.sh

# Patch spi_flash_hpm_enable.c
COPY ./patch_esp_spi_flash_hpm.sh /
RUN ./patch_esp_spi_flash_hpm.sh

# Install emscripten sdk
RUN git clone --depth 1 https://github.com/emscripten-core/emsdk.git
RUN cd emsdk && ./emsdk install latest && ./emsdk activate latest
Expand Down
2 changes: 0 additions & 2 deletions common/src/c/grid_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ void toml_cat_bare_key(char* dest, char* name) {

int grid_config_generate_cal(struct grid_cal_model* cal, char* dest) {

int status;

toml_cat_table_header(dest, CAL_HEADER);

char temp[GRID_CONFIG_MAX_UINT16_ARRAYELEM + 1] = {0};
Expand Down
2 changes: 1 addition & 1 deletion d51n20a/grid/vmp/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

mkdir -p build
gcc -flto -O2 -g -o build/proc proc.c vmp_def.c ../../../../vmp/vmp.c -I ./ -I ../../../../vmp
gcc -flto -O2 -g -o build/proc proc.c vmp_def.c ../../../common/dep/vmp/vmp.c -I ./ -I ../../../common/dep/vmp
2 changes: 1 addition & 1 deletion d51n20a/grid/vmp/execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

DEVICE="/dev/ttyUSB1"

../../../vmp/build/recv -i "${DEVICE}" | ./build/proc
../../../common/dep/vmp/build/recv -i "${DEVICE}" | ./build/proc
51 changes: 25 additions & 26 deletions d51n20a/grid_d51n20a.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include "usb/class/midi/device/audiodf_midi.h"

extern const struct luaL_Reg* grid_lua_api_generic_lib_reference;
const struct luaL_Reg grid_lua_api_gui_lib_reference[] = {{NULL, NULL}};
const struct luaL_Reg gui_lib[] = {{NULL, NULL}};
const struct luaL_Reg* grid_lua_api_gui_lib_reference = gui_lib;

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -354,6 +355,15 @@ void grid_d51_port_recv_uwsr(struct grid_port* port, struct grid_uwsr_t* uwsr, s

int main(void) {

// Allocate profiler & assign its interface
vmp_buf_malloc(&vmp, 2, sizeof(struct vmp_evt_t));
struct vmp_reg_t reg = {
.evt_serialized_size = vmp_evt_serialized_size,
.evt_serialize = vmp_evt_serialize,
.fwrite = vmp_fwrite,
};
bool vmp_flushed = false;

atmel_start_init(); // this sets up gpio and printf

grid_platform_printf("Start Initialized %d %s\r\n", 123, "Cool!");
Expand All @@ -379,11 +389,6 @@ int main(void) {

grid_d51_nvic_debug_priorities();

// Load page zero
grid_ui_bulk_start_with_state(&grid_ui_state, grid_ui_bulk_page_load, 0, 0, NULL);
update_interrupt_mask_from_bulk_status();
grid_ui_bulk_flush(&grid_ui_state);

// grid_d51_nvm_toc_debug(&grid_d51_nvm_state);

init_timer();
Expand Down Expand Up @@ -428,36 +433,30 @@ int main(void) {

struct grid_transport* xport = &grid_transport_state;

// Allocate profiler & assign its interface
vmp_buf_malloc(&vmp, 100, sizeof(struct vmp_evt_t));
struct vmp_reg_t reg = {
.evt_serialized_size = vmp_evt_serialized_size,
.evt_serialize = vmp_evt_serialize,
.fwrite = vmp_fwrite,
};
bool vmp_flushed = false;
// Load page zero
grid_ui_bulk_start_with_state(&grid_ui_state, grid_ui_bulk_page_load, 0, 0, NULL);
update_interrupt_mask_from_bulk_status();
grid_ui_bulk_flush(&grid_ui_state);

while (1) {

// vmp_push(MAIN);

/*
if (!vmp_flushed && vmp.size == vmp.capacity) {
if (!vmp_flushed && vmp.size == vmp.capacity) {

CRITICAL_SECTION_ENTER();
CRITICAL_SECTION_ENTER();

vmp_serialize_start(&reg);
vmp_buf_serialize_and_write(&vmp, &reg);
vmp_uid_str_serialize_and_write(VMP_UID_COUNT, VMP_ASSOC, &reg);
vmp_serialize_close(&reg);
vmp_serialize_start(&reg);
vmp_buf_serialize_and_write(&vmp, &reg);
vmp_uid_str_serialize_and_write(VMP_UID_COUNT, VMP_ASSOC, &reg);
vmp_serialize_close(&reg);

CRITICAL_SECTION_LEAVE();
CRITICAL_SECTION_LEAVE();

// vmp_buf_free(&vmp);
// vmp_buf_free(&vmp);

vmp_flushed = true;
}
*/
vmp_flushed = true;
}

loopcounter++;

Expand Down
6 changes: 3 additions & 3 deletions esp32s3/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y
# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set
# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set
# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set
CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y
# CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS is not set
# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set
# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set
# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set
Expand Down Expand Up @@ -2087,8 +2087,8 @@ CONFIG_SPI_FLASH_UNDER_HIGH_FREQ=y
CONFIG_SPI_FLASH_HPM_AUTO=y
# CONFIG_SPI_FLASH_HPM_DIS is not set
CONFIG_SPI_FLASH_HPM_ON=y
CONFIG_SPI_FLASH_HPM_DC_AUTO=y
# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set
# CONFIG_SPI_FLASH_HPM_DC_AUTO is not set
CONFIG_SPI_FLASH_HPM_DC_DISABLE=y
# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set
CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50
# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set
Expand Down
11 changes: 11 additions & 0 deletions patch_esp_spi_flash_hpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

if [ -z "$IDF_PATH" ]; then
echo "Error: IDF_PATH is not set" >&2
exit 1
fi

FILEPATH=$IDF_PATH/components/spi_flash/spi_flash_hpm_enable.c
sed -i "/#warning High Performance Mode/d" "$FILEPATH"
Loading