Skip to content

Commit

Permalink
Merge branch 'change/add_zephyr_target_logging' into 'master'
Browse files Browse the repository at this point in the history
docs: Update log output for Zephyr example

See merge request espressif/esp-serial-flasher!133
  • Loading branch information
dobairoland committed Jan 7, 2025
2 parents 53d73e3 + 7abd989 commit c7b8433
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/zephyr_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,27 @@ Binaries to be flashed are placed in a separate folder (binaries.c) for each pos

Here is the example's console output:

```
*** Booting Zephyr OS build zephyr-v3.2.0-3548-ga1bb9c9d1736 ***
``` text
Running ESP Flasher from Zephyr
Connected to target
Baudrate changed
Transmission rate changed.
Erasing flash (this may take a while)...
Start programming
Progress: 100 %
Finished programming
Flash verified
Erasing flash (this may take a while)...
Start programming
Progress: 100 %
Finished programming
Flash verified
Erasing flash (this may take a while)...
Start programming
Progress: 100 %
Finished programming
Flash verified
********************************************
*** Logs below are print from slave .... ***
********************************************
Hello world!
```
15 changes: 15 additions & 0 deletions examples/zephyr_example/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/sys/util.h>

#include <stdio.h>
Expand Down Expand Up @@ -77,5 +78,19 @@ int main(void)

esp_loader_reset_target();

if (loader_port_change_transmission_rate(DEFAULT_BAUDRATE) == ESP_LOADER_SUCCESS) {
// Delay for skipping the boot message of the targets
k_msleep(500);

printk("********************************************\n");
printk("*** Logs below are print from slave .... ***\n");
printk("********************************************\n");
while (1) {
uint8_t c;
if (uart_poll_in(esp_uart_dev, &c) == 0) {
printk("%c", c);
}
}
}
return 0;
}

0 comments on commit c7b8433

Please sign in to comment.