maxikrie opened a new pull request, #3927:
URL: https://github.com/apache/nuttx-apps/pull/3927

   ## Summary
   
   `examples/flowc/CMakeLists.txt` was a stub since the initial CMake support 
(`nuttx_add_application(NAME flowc)`, no sources), so CMake builds with 
`CONFIG_EXAMPLES_FLOWC` failed to link:
   
   ```
   undefined reference to `flowc_main'
   ```
   
   This builds it as the Makefile does: target 1 (receiver, or sender with 
`EXAMPLES_FLOWC_SENDER1`), target 2 (the other end) with 
`EXAMPLES_FLOWC_TARGET2`, with their PROGNAME/PRIORITY/STACKSIZE options, and 
`nuttx/config.h` reachable as `"config.h"` the way `examples/tcpblaster` does. 
The host-side tool stays Makefile-only.
   
   ## Impact
   
   CMake builds with `EXAMPLES_FLOWC`.
   
   ## Testing
   
   `nrf52840-dk:cdcacm` (CMake) + `SERIAL_TERMIOS`, `SERIAL_IFLOWCONTROL`, 
`CDCACM_IFLOWCONTROL`, `EXAMPLES_FLOWC`:
   
   | variant | before | after |
   |---|---|---|
   | receiver (default) | link fails | builtin `flowc` |
   | `EXAMPLES_FLOWC_SENDER1` | link fails | builtin `flowc` |
   | `EXAMPLES_FLOWC_TARGET2` | link fails | builtins `flowc1`, `flowc2` |
   
   On an nRF52840-DK, `flowc` as receiver on the USB CDC ACM port got the full 
97,280-byte pattern from the host with no errors. `tools/checkpatch.sh -f 
examples/flowc/CMakeLists.txt` passes.
   
   ## Logs
   
   <details><summary>Before: link fails</summary>
   
   ```
   FAILED: nuttx
   ld: 
apps/builtin/libapps_builtin.a(builtin_list.c.o):(.rodata.g_builtins+0x5c): 
undefined reference to `flowc_main'
   collect2: error: ld returned 1 exit status
   ```
   </details>
   
   <details><summary>After: builtin lists</summary>
   
   ```
   default:      { "flowc", 100, 2048, flowc_main },
   SENDER1:      { "flowc", 100, 2048, flowc_main },
   TARGET2:      { "flowc1", 100, 2048, flowc1_main }, { "flowc2", 100, 2048, 
flowc2_main },
   ```
   </details>
   
   <details><summary>After: runtime on an nRF52840-DK (receiver on 
/dev/ttyACM0, USB CDC ACM)</summary>
   
   ```
   nsh> sercon
   sercon: Registering CDC/ACM serial driver
   sercon: Successfully registered the CDC/ACM serial driver
   nsh> flowc &
   flowc [4:100]
   
   host: sent 97280 bytes in 166.21 s
   
   (no "receiver: ERROR" lines; flowc exited after the last byte)
   ```
   </details>
   ## Summary
   
   `examples/flowc/CMakeLists.txt` was a stub since the initial CMake support 
(`nuttx_add_application(NAME flowc)`, no sources), so CMake builds with 
`CONFIG_EXAMPLES_FLOWC` failed to link:
   
   ```
   undefined reference to `flowc_main'
   ```
   
   This builds it as the Makefile does: target 1 (receiver, or sender with 
`EXAMPLES_FLOWC_SENDER1`), target 2 (the other end) with 
`EXAMPLES_FLOWC_TARGET2`, with their PROGNAME/PRIORITY/STACKSIZE options, and 
`nuttx/config.h` reachable as `"config.h"` the way `examples/tcpblaster` does. 
The host-side tool stays Makefile-only.
   
   ## Impact
   
   CMake builds with `EXAMPLES_FLOWC`.
   
   ## Testing
   
   `nrf52840-dk:cdcacm` (CMake) + `SERIAL_TERMIOS`, `SERIAL_IFLOWCONTROL`, 
`CDCACM_IFLOWCONTROL`, `EXAMPLES_FLOWC`:
   
   | variant | before | after |
   |---|---|---|
   | receiver (default) | link fails | builtin `flowc` |
   | `EXAMPLES_FLOWC_SENDER1` | link fails | builtin `flowc` |
   | `EXAMPLES_FLOWC_TARGET2` | link fails | builtins `flowc1`, `flowc2` |
   
   On an nRF52840-DK, `flowc` as receiver on the USB CDC ACM port got the full 
97,280-byte pattern from the host with no errors. `tools/checkpatch.sh -f 
examples/flowc/CMakeLists.txt` passes.
   
   ## Logs
   
   <details><summary>Before: link fails</summary>
   
   ```
   FAILED: nuttx
   ld: 
apps/builtin/libapps_builtin.a(builtin_list.c.o):(.rodata.g_builtins+0x5c): 
undefined reference to `flowc_main'
   collect2: error: ld returned 1 exit status
   ```
   </details>
   
   <details><summary>After: builtin lists</summary>
   
   ```
   default:      { "flowc", 100, 2048, flowc_main },
   SENDER1:      { "flowc", 100, 2048, flowc_main },
   TARGET2:      { "flowc1", 100, 2048, flowc1_main }, { "flowc2", 100, 2048, 
flowc2_main },
   ```
   </details>
   
   <details><summary>After: runtime on an nRF52840-DK (receiver on 
/dev/ttyACM0, USB CDC ACM)</summary>
   
   ```
   nsh> sercon
   sercon: Registering CDC/ACM serial driver
   sercon: Successfully registered the CDC/ACM serial driver
   nsh> flowc &
   flowc [4:100]
   
   host: sent 97280 bytes in 166.21 s
   
   (no "receiver: ERROR" lines; flowc exited after the last byte)
   ```
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to