Skip to content

Commit 00d6279

Browse files
committed
Merge branch 'bugfix/update_doc_link' into 'feature/esp_as_mcu_host'
bugfix/update_doc_link Updated README links, fixed bugs in UART transport See merge request app-frameworks/esp_hosted!517
2 parents 6664352 + e14534b commit 00d6279

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This high-level block diagram shows ESP-Hosted's relationship with the host MCU
1010

1111
For detailed design diagrams in Wi-Fi and Bluetooth, refer to the following design documents:
1212

13-
- [WiFi Design](docs/wifi_design.md)
14-
- [Bluetooth Design](docs/bluetooth_design.md)
13+
- [WiFi Design](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/wifi_design.md)
14+
- [Bluetooth Design](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/bluetooth_design.md)
1515

1616
This branch, `feature/esp_as_mcu_host` is dedicated for any host as MCU support. If you are interested in Linux as host, please refer to [`master`](https://github.com/espressif/esp-hosted/blob/master) branch.
1717

@@ -49,6 +49,9 @@ Impatient to test? We've got you covered!
4949
The [ESP32-P4-Function-EV-Board](https://www.espressif.com/en/products/socs/esp32-p4) can be used as a host MCU with an on-board [ESP32-C6](https://www.espressif.com/en/products/socs/esp32-c6) as co-processor, already connected via SDIO as transport.
5050
Prerequisite: You need to have an ESP32-P4-Function-EV-Board`
5151

52+
> [!NOTE]
53+
> If you have already set up ESP-IDF (version 5.3 or later), you can skip to [5 Source Code and Dependencies](#5-source-code-and-dependencies).
54+
5255
### 4.1 Set-Up ESP-IDF
5356

5457
- Windows
@@ -99,7 +102,6 @@ ESP-Hosted-MCU Solution is dependent on `ESP-IDF`, `esp_wifi_remote` and `protob
99102
- [`esp_wifi_remote`](https://components.espressif.com/components/espressif/esp_wifi_remote) i.e. 'Wi-Fi Remote' is very thin interface made up of ESP-IDF Wi-Fi APIs with empty weak definitions. Real definitions for these APIs are provided by ESP-Hosted-MCU
100103
- Wi-Fi Remote Code can be found at either [GitHub Repo](https://github.com/espressif/esp-protocols/tree/master/components/esp_wifi_remote) or [Espressif Registry Component](https://components.espressif.com/components/espressif/esp_wifi_remote)
101104

102-
103105
###### Protobuf
104106
- [`protobuf-c`](https://github.com/protobuf-c/protobuf-c) is data serialization framework provided by Google. RPC messages communicated in host and slave are protobuf encoded.
105107
- It helps to avoid manual serialization or endien-ness conversion.
@@ -119,7 +121,6 @@ ESP-Hosted-MCU Solution is dependent on `ESP-IDF`, `esp_wifi_remote` and `protob
119121
- These events terminate in standard ESP-IDF event loop on the host
120122
- Please note, Only RPC i.e. control packets are serialised. Data Packets are never serialised as they do not need endien conversion.
121123

122-
123124
## 6 Decide the communication bus in between host and slave
124125

125126
The communication bus is required to be setup correctly between host and slave.
@@ -218,7 +219,7 @@ Once you decided the transport to use, this section should guide how to set this
218219

219220
> [!IMPORTANT]
220221
>
221-
> [Design Considerations](docs/design_consideration.md) that could be reffered to, before you stick to any transport option. Referring to these consideration would help to get you faster to solution, make your design stable and less error-prone.
222+
> [Design Considerations](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/design_consideration.md) that could be reffered to, before you stick to any transport option. Referring to these consideration would help to get you faster to solution, make your design stable and less error-prone.
222223
223224

224225
Irrespective of transport chosen, following steps are needed, which are step-wise explained in each transport.
@@ -235,24 +236,24 @@ Irrespective of transport chosen, following steps are needed, which are step-wis
235236
- Host flashing
236237
- Host logs
237238

238-
- [**Standard SPI (Full duplex)**](docs/spi_full_duplex.md)
239+
- [**Standard SPI (Full duplex)**](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/spi_full_duplex.md)
239240

240-
- [**SPI - Dual / Quad Half Duplex**](docs/spi_half_duplex.md)
241+
- [**SPI - Dual / Quad Half Duplex**](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/spi_half_duplex.md)
241242

242-
- [**SDIO (1-Bit / 4-Bit)**](docs/sdio.md)
243+
- [**SDIO (1-Bit / 4-Bit)**](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/sdio.md)
243244

244-
- [**UART for Wi-Fi and Bluetooth**](docs/uart.md)
245+
- [**UART for Wi-Fi and Bluetooth**](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/uart.md)
245246

246247
## 9 Examples
247-
Check [examples](./examples) directory for sample applications using ESP-Hosted.
248+
Check [examples](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/examples) directory for sample applications using ESP-Hosted.
248249
- `examples/bleprph_host_only_vhci`
249250
- Bluetooth without needing extra GPIOs
250251

251252
## 10 Troubleshooting
252253

253254
If you encounter issues with using ESP-Hosted, see the following guide:
254255

255-
- [Troubleshooting Guide](docs/troubleshooting.md)
256+
- [Troubleshooting Guide](https://github.com/espressif/esp-hosted/blob/feature/esp_as_mcu_host/docs/troubleshooting.md)
256257

257258
## 11 References
258259

@@ -264,4 +265,3 @@ If you encounter issues with using ESP-Hosted, see the following guide:
264265
- [ESP Component Registry](https://components.espressif.com)
265266
- [Registry Component: esp\_wifi\_remote](https://components.espressif.com/components/espressif/esp_wifi_remote)
266267
- [Registry Component: esp\_hosted](https://components.espressif.com/components/espressif/esp_hosted)
267-

host/drivers/transport/uart/uart_drv.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static esp_err_t h_uart_push_data_to_queue(uint8_t * buf, uint32_t buf_len)
370370
if (update_flow_ctrl(buf)) {
371371
// detected and updated flow control
372372
// no need to further process the packet
373-
HOSTED_FREE(buf);
373+
h_uart_buffer_free(buf);
374374
return ESP_OK;
375375
}
376376

@@ -383,12 +383,13 @@ static esp_err_t h_uart_push_data_to_queue(uint8_t * buf, uint32_t buf_len)
383383
* wrong header/bit packing?
384384
* */
385385
ESP_LOGE(TAG, "Dropping packet");
386-
HOSTED_FREE(buf);
386+
h_uart_buffer_free(buf);
387387
return ESP_FAIL;
388388
}
389389

390390
if (h_uart_push_pkt_to_queue(buf, len, offset)) {
391391
ESP_LOGE(TAG, "Failed to push Rx packet to queue");
392+
h_uart_buffer_free(buf);
392393
return ESP_FAIL;
393394
}
394395

@@ -448,7 +449,6 @@ static int process_uart_rx_data(size_t size)
448449

449450
if (h_uart_push_data_to_queue(rxbuff, expected_pkt_len)) {
450451
ESP_LOGE(TAG, "Failed to push data to rx queue");
451-
HOSTED_FREE(rxbuff);
452452
}
453453

454454
// clean up the scratch buffer
@@ -490,7 +490,8 @@ static void h_uart_read_task(void const* pvParameters)
490490
ESP_LOGE(TAG, "error waiting for uart data");
491491
continue;
492492
}
493-
process_uart_rx_data(rx_len);
493+
if (rx_len)
494+
process_uart_rx_data(rx_len);
494495
}
495496
}
496497

host/port/uart_wrapper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ int hosted_wait_rx_data(uint32_t ticks_to_wait)
8383
break;
8484
case UART_BREAK:
8585
ESP_LOGW(TAG, "uart rx break");
86+
res = 0;
8687
break;
8788
case UART_PARITY_ERR:
8889
ESP_LOGE(TAG, "uart parity error");

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.0.18"
1+
version: "0.0.19"
22
description: ESP-Hosted provides driver such that any host can re-use ESP chipset as Wi-Fi or Bluetooth co-processor.
33
url: https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host
44
examples:

0 commit comments

Comments
 (0)