Skip to content

Commit

Permalink
Merge branch 'bugfix/update_doc_link' into 'feature/esp_as_mcu_host'
Browse files Browse the repository at this point in the history
bugfix/update_doc_link Updated README links, fixed bugs in UART transport

See merge request app-frameworks/esp_hosted!517
  • Loading branch information
mantriyogesh committed Sep 30, 2024
2 parents 6664352 + e14534b commit 00d6279
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This high-level block diagram shows ESP-Hosted's relationship with the host MCU

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

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

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.

Expand Down Expand Up @@ -49,6 +49,9 @@ Impatient to test? We've got you covered!
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.
Prerequisite: You need to have an ESP32-P4-Function-EV-Board`

> [!NOTE]
> 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).
### 4.1 Set-Up ESP-IDF

- Windows
Expand Down Expand Up @@ -99,7 +102,6 @@ ESP-Hosted-MCU Solution is dependent on `ESP-IDF`, `esp_wifi_remote` and `protob
- [`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
- 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)


###### Protobuf
- [`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.
- It helps to avoid manual serialization or endien-ness conversion.
Expand All @@ -119,7 +121,6 @@ ESP-Hosted-MCU Solution is dependent on `ESP-IDF`, `esp_wifi_remote` and `protob
- These events terminate in standard ESP-IDF event loop on the host
- Please note, Only RPC i.e. control packets are serialised. Data Packets are never serialised as they do not need endien conversion.


## 6 Decide the communication bus in between host and slave

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

> [!IMPORTANT]
>
> [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.
> [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.

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

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

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

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

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

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

## 10 Troubleshooting

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

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

## 11 References

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

9 changes: 5 additions & 4 deletions host/drivers/transport/uart/uart_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static esp_err_t h_uart_push_data_to_queue(uint8_t * buf, uint32_t buf_len)
if (update_flow_ctrl(buf)) {
// detected and updated flow control
// no need to further process the packet
HOSTED_FREE(buf);
h_uart_buffer_free(buf);
return ESP_OK;
}

Expand All @@ -383,12 +383,13 @@ static esp_err_t h_uart_push_data_to_queue(uint8_t * buf, uint32_t buf_len)
* wrong header/bit packing?
* */
ESP_LOGE(TAG, "Dropping packet");
HOSTED_FREE(buf);
h_uart_buffer_free(buf);
return ESP_FAIL;
}

if (h_uart_push_pkt_to_queue(buf, len, offset)) {
ESP_LOGE(TAG, "Failed to push Rx packet to queue");
h_uart_buffer_free(buf);
return ESP_FAIL;
}

Expand Down Expand Up @@ -448,7 +449,6 @@ static int process_uart_rx_data(size_t size)

if (h_uart_push_data_to_queue(rxbuff, expected_pkt_len)) {
ESP_LOGE(TAG, "Failed to push data to rx queue");
HOSTED_FREE(rxbuff);
}

// clean up the scratch buffer
Expand Down Expand Up @@ -490,7 +490,8 @@ static void h_uart_read_task(void const* pvParameters)
ESP_LOGE(TAG, "error waiting for uart data");
continue;
}
process_uart_rx_data(rx_len);
if (rx_len)
process_uart_rx_data(rx_len);
}
}

Expand Down
1 change: 1 addition & 0 deletions host/port/uart_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ int hosted_wait_rx_data(uint32_t ticks_to_wait)
break;
case UART_BREAK:
ESP_LOGW(TAG, "uart rx break");
res = 0;
break;
case UART_PARITY_ERR:
ESP_LOGE(TAG, "uart parity error");
Expand Down
2 changes: 1 addition & 1 deletion idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.0.18"
version: "0.0.19"
description: ESP-Hosted provides driver such that any host can re-use ESP chipset as Wi-Fi or Bluetooth co-processor.
url: https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host
examples:
Expand Down

0 comments on commit 00d6279

Please sign in to comment.