--- tags: [entity] type: entity topic: stm32-lower note: 17 created: 2026-07-16 updated: 2026-07-16 --- # Note 17: LoRa (lower/stm32/13~14) ## Projects | # | Directory | Description | |---|---|---| | 13 | `13_lora_node_hal` | LoRa Node (LLCC68) | | 14 | `14_lora_gateway_hal` | LoRa Gateway | ## Code Accuracy Audit ### Path Audit | Claimed Path | Actual Path | Status | |---|---|---| | `stm32/13_lora_node_hal/Core/Src/main.c` | `13_lora_node_hal/Core/Src/main.c` | ✅ Correct | | `stm32/13_lora_node_hal/Interface/LoRa/lora.c` | `13_lora_node_hal/Interface/LoRa/lora.c` | ✅ Correct | | `stm32/13_lora_node_hal/Interface/LoRa/lora.h` | `13_lora_node_hal/Interface/LoRa/lora.h` | ✅ Correct | | `stm32/14_lora_gateway_hal/Core/Src/main.c` | `14_lora_gateway_hal/Core/Src/main.c` | ✅ Correct | ### LoRa Init (lora.c) Note claims `LoRa_Init` uses `DRIVER_LLCC68_LINK_INIT` macros and `llcc68_init` → All match actual code (394-line file). | Claimed Parameter | Actual Value | Match? | |---|---|---| | `LLCC68_LORA_DEFAULT_SF` = SF9 | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_BANDWIDTH` = 125 KHz | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_CR` = CR 4/5 | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_TX_DBM` = 17 dBm | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_RF_FREQUENCY` = 480000000 | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_SYNC_WORD` = 0x3444 | `lora.h` define | ✅ Match | | `LLCC68_LORA_DEFAULT_PREAMBLE_LENGTH` = 12 | `lora.h` define | ✅ Match | ### LoRa Send/Receive | Claimed by Note | Actual Code | Match? | |---|---|---| | `TXEN_HIGH; RXEN_LOW;` before send | Present in lora.c | ✅ Match | | `TXEN_LOW; RXEN_HIGH;` for RX mode | Present in lora.c | ✅ Match | | `llcc68_lora_transmit(...)` for send | Present | ✅ Match | | `llcc68_continuous_receive(...)` for RX | Present | ✅ Match | | `llcc68_irq_handler(&gs_handle)` then memcpy | Present | ✅ Match | | GPIO EXTI callback for key press | In main.c | ✅ Match | ### Node main.c logic Note claims: - Key press triggers send ("一个普通LoRa节点") - RX mode by default - Gateway echoes back on receive All match actual code. ## Summary **Overall Accuracy**: Very High **Issues Found**: None significant. All parameters, functions, and driver call sequence match the actual code.