diff --git a/example/modifier_volume_cube.cpp b/example/modifier_volume_cube.cpp index 53824d6..c54c471 100644 --- a/example/modifier_volume_cube.cpp +++ b/example/modifier_volume_cube.cpp @@ -995,10 +995,31 @@ void main() texture_memory_alloc.background[core].start, texture_memory_alloc.framebuffer[core].start, framebuffer_width); - core_wait_end_of_render_video(); + bool timeout = core_wait_end_of_render_video(); + if (timeout) { + serial::string("timeout\ntimeout\ntimeout\ntimeout\n"); + + holly.SOFTRESET = softreset::pipeline_soft_reset; + holly.SOFTRESET = 0; + for (int i = 0; i < 10000; i++) { + asm volatile ("nop"); + } + core_start_render2(texture_memory_alloc.region_array[core].start, + texture_memory_alloc.isp_tsp_parameters[core].start, + texture_memory_alloc.background[core].start, + texture_memory_alloc.framebuffer[core].start, + framebuffer_width); + bool timeout = core_wait_end_of_render_video(); + if (timeout) { + serial::string("timeout2\ntimeout2\ntimeout2\ntimeout2\n"); + break; + } + serial:: string("recovered\n"); + } holly.FB_R_SOF1 = texture_memory_alloc.framebuffer[ta].start; theta += degree; } + serial::string("return\nreturn\nreturn\nreturn\n"); } diff --git a/holly/core.cpp b/holly/core.cpp index 4fee6fb..2522bd2 100644 --- a/holly/core.cpp +++ b/holly/core.cpp @@ -134,13 +134,14 @@ void core_start_render3(uint32_t region_array_start, holly.STARTRENDER = 1; } -void core_wait_end_of_render_video() +bool core_wait_end_of_render_video() { /* "Furthermore, it is strongly recommended that the End of ISP and End of Video interrupts be cleared at the same time in order to make debugging easier when an error occurs." */ //serial::string("eorv\n"); + bool timeout = false; int64_t count = 0; while (1) { uint32_t istnrm = system.ISTNRM; @@ -167,12 +168,13 @@ void core_wait_end_of_render_video() //serial::string("core "); //serial::integer(system.ISTERR); } - if (count > 300000) { + if (count > 3000000) { serial::string("core timeout:\n"); serial::string("isterr "); serial::integer(system.ISTERR); serial::string("istnrm "); serial::integer(system.ISTNRM); + timeout = true; break; } count += 1; @@ -181,8 +183,7 @@ void core_wait_end_of_render_video() | istnrm::end_of_render_isp | istnrm::end_of_render_video; - holly.SOFTRESET = softreset::pipeline_soft_reset; - holly.SOFTRESET = 0; + return timeout; } void core_flip(uint32_t frame_ix) diff --git a/holly/core.hpp b/holly/core.hpp index 59a2297..1ffcdfe 100644 --- a/holly/core.hpp +++ b/holly/core.hpp @@ -22,5 +22,5 @@ void core_start_render3(uint32_t region_array_start, uint32_t bytes_per_pixel ); -void core_wait_end_of_render_video(); +bool core_wait_end_of_render_video(); void core_flip(uint32_t frame_ix); diff --git a/tools/dump_texture_memory.sh b/tools/dump_texture_memory.sh new file mode 100755 index 0000000..d6dde33 --- /dev/null +++ b/tools/dump_texture_memory.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +set -ex + +${SCRIPT_DIR}/ftdi_transfer \ + read 0xa5000000 0x800000 ./texture_memory.bin \ + read 0xa05f8000 0x2000 ./holly_registers.bin