core: add timeout bool

This commit is contained in:
Zack Buhman 2025-02-11 14:13:03 -06:00
parent ad2e968f07
commit 37ccafc9c8
4 changed files with 37 additions and 6 deletions

View File

@ -995,10 +995,31 @@ void main()
texture_memory_alloc.background[core].start, texture_memory_alloc.background[core].start,
texture_memory_alloc.framebuffer[core].start, texture_memory_alloc.framebuffer[core].start,
framebuffer_width); 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; holly.FB_R_SOF1 = texture_memory_alloc.framebuffer[ta].start;
theta += degree; theta += degree;
} }
serial::string("return\nreturn\nreturn\nreturn\n");
} }

View File

@ -134,13 +134,14 @@ void core_start_render3(uint32_t region_array_start,
holly.STARTRENDER = 1; 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 "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." be cleared at the same time in order to make debugging easier when an error occurs."
*/ */
//serial::string("eorv\n"); //serial::string("eorv\n");
bool timeout = false;
int64_t count = 0; int64_t count = 0;
while (1) { while (1) {
uint32_t istnrm = system.ISTNRM; uint32_t istnrm = system.ISTNRM;
@ -167,12 +168,13 @@ void core_wait_end_of_render_video()
//serial::string("core "); //serial::string("core ");
//serial::integer<uint32_t>(system.ISTERR); //serial::integer<uint32_t>(system.ISTERR);
} }
if (count > 300000) { if (count > 3000000) {
serial::string("core timeout:\n"); serial::string("core timeout:\n");
serial::string("isterr "); serial::string("isterr ");
serial::integer<uint32_t>(system.ISTERR); serial::integer<uint32_t>(system.ISTERR);
serial::string("istnrm "); serial::string("istnrm ");
serial::integer<uint32_t>(system.ISTNRM); serial::integer<uint32_t>(system.ISTNRM);
timeout = true;
break; break;
} }
count += 1; count += 1;
@ -181,8 +183,7 @@ void core_wait_end_of_render_video()
| istnrm::end_of_render_isp | istnrm::end_of_render_isp
| istnrm::end_of_render_video; | istnrm::end_of_render_video;
holly.SOFTRESET = softreset::pipeline_soft_reset; return timeout;
holly.SOFTRESET = 0;
} }
void core_flip(uint32_t frame_ix) void core_flip(uint32_t frame_ix)

View File

@ -22,5 +22,5 @@ void core_start_render3(uint32_t region_array_start,
uint32_t bytes_per_pixel 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); void core_flip(uint32_t frame_ix);

9
tools/dump_texture_memory.sh Executable file
View File

@ -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