fix: resolve 3 deferred issues (STM32-006, STM32-004, FPGA-001)

STM32-006: Remove blocking do-while loop that waited for legacy GUI start
flag — production V7 PyQt GUI never sends it, hanging the MCU at boot.

STM32-004: Check ad9523_init() return code and call Error_Handler() on
failure, matching the pattern used by all other hardware init calls.

FPGA-001: Simplify frame boundary detection to only trigger on
chirp_counter wrap-to-zero. Previous conditions checking == N and == 2N
were unreachable dead code (counter wraps at N-1). Now correct for any
chirps_per_elev value.
This commit is contained in:
Jason
2026-04-16 00:13:45 +05:45
parent b0e5b298fe
commit 8187771ab0
2 changed files with 22 additions and 35 deletions
+8 -10
View File
@@ -404,16 +404,14 @@ always @(posedge clk or negedge reset_n) begin
// Default: no pulse
new_frame_pulse <= 1'b0;
// Dynamic frame detection using host_chirps_per_elev.
// Detect frame boundary when chirp_counter changes AND is a
// multiple of host_chirps_per_elev (0, N, 2N, 3N, ...).
// Uses a modulo counter that resets at host_chirps_per_elev.
if (chirp_counter != chirp_counter_prev) begin
if (chirp_counter == 6'd0 ||
chirp_counter == host_chirps_per_elev ||
chirp_counter == {host_chirps_per_elev, 1'b0}) begin
new_frame_pulse <= 1'b1;
end
// [FPGA-001 FIXED] Detect frame boundary when chirp_counter wraps to 0.
// The chirp_counter (driven by radar_mode_controller) counts 0..N-1
// and wraps back to 0 at the start of each new frame. Previous code
// also checked (== host_chirps_per_elev) and (== 2*host_chirps_per_elev)
// which were unreachable dead conditions for any N, since the counter
// never reaches N. Now works correctly for any chirps_per_elev value.
if (chirp_counter != chirp_counter_prev && chirp_counter == 6'd0) begin
new_frame_pulse <= 1'b1;
end
// Store previous value