Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial merge of Wi-Fi support code for ctxLink. #1927

Open
wants to merge 48 commits into
base: main
Choose a base branch
from

Conversation

sidprice
Copy link
Contributor

@sidprice sidprice commented Sep 9, 2024

Detailed description

This PR brings an early version of Wi-Fi support for ctxLink. Initially, it attempts to update the souce code to fit more closely with the style of BMF source code as definied by Clang-Tidy.

The built firmware, while offering initiall Wi-Fi connectivity and operation, is not full featured. The intent of this PR is to allow outstanding features in smaller PRs, thus reducing the burden on the author and the reviewer.

Your checklist for this pull request

Closing issues

None

@dragonmux dragonmux added this to the v2.0 release milestone Sep 9, 2024
@dragonmux dragonmux added Enhancement General project improvement Foreign Host Board Non Native hardware to runing Black Magic firmware on labels Sep 9, 2024
@sidprice sidprice force-pushed the ctxLink_wifi branch 3 times, most recently from ed23bcf to 66d60b2 Compare September 10, 2024 19:24
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done an initial review, there are still several more files we need to look at but this gives some easy first items to deal with.

src/platforms/ctxlink/platform.h Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.h Outdated Show resolved Hide resolved
src/platforms/ctxlink/ctxLink_mode_led.h Outdated Show resolved Hide resolved
src/platforms/ctxlink/winc1500_driver_stub_api.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/winc1500_driver_stub_api.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
@sidprice sidprice force-pushed the ctxLink_wifi branch 2 times, most recently from 18e79dd to 5a7a3d1 Compare September 29, 2024 20:37
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this review, we have only the WiFi server implementation to review and we think we've covered most of the rest. Some of the comments likely apply across multiple files, so if you see, eg, u_int32_t in another file to the one commented in, then our uint32_t comment applies to it as well.

src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/winc1500_driver_stub_api.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/ctxLink_mode_led.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/ctxLink_mode_led.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/WiFi_Server.h Outdated Show resolved Hide resolved
bool is_swo_trace_client_connected(void);
void send_swo_trace_data(uint8_t *lpBuffer, uint8_t length);

void wifi_gdb_putchar(unsigned char ch, int flush);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We believe that flush should be bool here - you'll need to #include <stdbool.h> at the top of the file for that but it should otherwise be good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is based up the common/stm32/gdb_if.c file, which as:
void gdb_if_putchar(const char c, const int flush)

src/platforms/ctxlink/WiFi_Server.h Outdated Show resolved Hide resolved
@sidprice sidprice force-pushed the ctxLink_wifi branch 2 times, most recently from 613870d to 6bfc7f9 Compare October 2, 2024 23:28
src/platforms/ctxlink/platform.c Outdated Show resolved Hide resolved
src/platforms/ctxlink/ctxLink_traceswo.c Show resolved Hide resolved
src/platforms/ctxlink/ctxLink_mode_led.c Outdated Show resolved Hide resolved
@sidprice sidprice force-pushed the ctxLink_wifi branch 5 times, most recently from ba7c432 to 761cb41 Compare October 3, 2024 21:50
Also fix local variable "count" to match sscanf return
type.
…attribute.

Also, simplify the access function.
Also, add define for RX/TX buffer sizes for clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement General project improvement Foreign Host Board Non Native hardware to runing Black Magic firmware on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants