README.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ESP32 receive/transmit refactor validation
  2. Active implementation is entirely in DriverInterface/ESP32_WROOM_32D.c.
  3. The older wifi_stream.h / wifi_receive_stream.inc files are not included.
  4. Preserved contracts:
  5. - WriteComm2(char *, uint16_t) is the only physical send path.
  6. - g_wifi_rx_buf remains 256 bytes. g_wifi_rx_last is the ISR write cursor;
  7. g_wifi_rx_head is the main-loop read cursor.
  8. - Every complete Mini7 message is decoded by the Keil project's existing
  9. tshell/van_com_algorithm.c DecodeNew, including its legacy checksum rules.
  10. - Command formatting goes through my_sprintf, now bounded by vsnprintf.
  11. - Diagnostics use Van_Device_Printf(VAN_LOG_WIFI, ...).
  12. Receiving:
  13. - Main loop drains the ring without the former 100ms gate.
  14. - ISR detects ring-full/ORE; it does not silently overwrite unread bytes.
  15. - AT lines, prompts and +IPD payloads are consumed in wire order.
  16. - CIPMUX=1 and CIPDINFO=0 are configured explicitly.
  17. - STA dispatches connection 0; SoftAP provisioning accepts client IDs 0..4
  18. through the same streaming parser, without mixing clients' JSON fragments.
  19. - Mini7 partial frames survive multiple +IPD segments, with a 128-byte maximum
  20. inbound payload matching CMD_BUF_SIZE. The actual ring stays 256 bytes.
  21. - Complete frames use a separate contiguous DecodeNew window so decoding
  22. cannot move the hardware ring cursor or erase newly arrived input.
  23. Sending:
  24. - IDLE -> WAIT_PROMPT (3000ms) -> WAIT_RESULT (7000ms) -> IDLE.
  25. - Payload is sent once per prompt transaction, without a trailing extra byte.
  26. - TCP connection success is followed by CIPTCPOPT=0,,,6000; only its OK enables
  27. application TX. UDP skips TCP options.
  28. - Explicit ERROR before prompt or SEND FAIL after payload releases the pending
  29. frame; existing application-level ACK/retry logic is responsible for retry.
  30. - Ambiguous timeout, UART write failure, malformed +IPD or ring overrun latches
  31. TX_FAULT and sends no further AT. Reset ESP/the device; ready clears the latch.
  32. There is no hardware ESP reset pin configured in this module.
  33. - Close/SSID requests are deferred until the current transaction finishes.
  34. Host test:
  35. python tests/wifi_refactor/build_host_test.py
  36. In a Visual Studio compiler shell:
  37. cl /nologo /TC /utf-8 /DONECHIP_MINI_ONE tests/wifi_refactor/generated.c DriverInterface/cJSON.c /Fe:tests/wifi_refactor/test.exe /Fo:tests/wifi_refactor/
  38. tests/wifi_refactor/test.exe
  39. The generator reads the CURRENT production C and actual DecodeNew, not a
  40. duplicate decoder model. Covers maximum frame fragmentation, ring wrap,
  41. 1000 frames, binary delimiters, corruption, callbacks receiving new bytes,
  42. prompt timeout, duplicate prompt, send-result timing, UART error, TCP/UDP setup.
  43. Repeat with /DONECHIP_MINI_PLUS to test the other device variant.
  44. Also covers IPD payloads larger than the ring, SoftAP setup/fragmented JSON,
  45. prompt-only payload release, busy provisioning requests and bounded searches.
  46. 2026-10-26 hardware smoke test:
  47. - Full rebuild of mini7_V2_debug with ONECHIP_MINI_ONE: 0 errors, 3 existing
  48. warnings (debug watchdog unreachable code x2, unused stub_RtR x1).
  49. - ST-LINK programming and verification passed; application reset and running.
  50. - COM10 and the existing tool_for_mini TCP/UDP server used for validation.
  51. - 10:32:32..10:34:37: 58 valid TCP responses, 62 SEND OK, maximum observed
  52. response gap 5 seconds, no observed checksum errors, UART faults, AT timeouts,
  53. reset commands or SEND FAIL. Covers periodic status queries, not a full run.
  54. - Ambient temperature -104 indicates an unloaded sensor channel, unresolved.
  55. - Both Keil targets share output files: use a full rebuild when changing target.
  56. - Raw serial/network logs and AXF files are local artifacts, not test sources.