Custom bootloader

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
cedric_roomz
Level 4
Level 4
50 replies posted 50 sign-ins 25 replies posted

Hi,

 

I'm trying to make a custom bootloader with Wiced for CYW43907.

The aim is to implement a custom implementation of direct firmware update. 

I based it on waf/ota2_bootloader.For the uart I'm using platform_stdio with WICED_UART_1, /* ChipCommon Slow UART */

It's built as roomz.custom_bootloader-NoOS-NoNS-CYW943907AEVAL1F JTAG=jlink VERBOSE=1 download_apps download

 

So far it's compiling, linking, programming, starting and printing to uart. Which is already nice : )

I'm having troubles with reading uart , and I do not understand how the platform_stdio.c shall work.

- Can you explain to me how the stdio_tx_mutex works? Where is it set?

- Is there an implementation of semaphore which handles timeouts ? In Wiced/rtos/NoOS/WWD/wwd_rtos.c the timeout is ignored.

 

Current implementation flash/ram usage:

Module | Flash | Static  RAM |
----------------------------------+---------+---------|
App | 0 | 66220 |
Interrupt Vectors | 0 | 296 |
libc | 0 | 33504 |
NoOS | 0 | 776 |
Other | 0 | 17340 |
platform | 0 | 444 |
RAM Initialisation | 32 | 0 |
Ring_Buffer | 0 | 132 |
Startup Stack & Link Script fill | 0 | 56 |
WWD | 0 | 248 |
----------------------------------+---------+---------|
TOTAL (bytes) | 0 | 119016 |

 

I can provide the project in private message if needed.

0 Likes
1 Solution
Rakesh_BG
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted 100 sign-ins

Hi @cedric_roomz ,

Can you please refer to the example code present in wiced/apps/snip/uart . 

Basically both the methods should work. We can check your code if it is not solving your problem.

you may have to ring buffer to receive the data through UART and the API to receive is wiced_uart_receive_bytes.

Thanks,

Rakesh B G

View solution in original post

0 Likes
2 Replies
cedric_roomz
Level 4
Level 4
50 replies posted 50 sign-ins 25 replies posted

So now I've removed the platform_stdio and use platform_uart_ instead.  

The write still works fine. But I cannot make the read work.

- Is there an implementation of semaphore which handles timeouts ? In Wiced/rtos/NoOS/WWD/wwd_rtos.c the timeout is ignored.

- Shall the uart read works with UART_SLOW and NoOS? 

- Shall I use BCM4390X_UART_SLOW_POLL_MODE  or normal mode?

0 Likes
Rakesh_BG
Moderator
Moderator
Moderator
50 solutions authored 100 replies posted 100 sign-ins

Hi @cedric_roomz ,

Can you please refer to the example code present in wiced/apps/snip/uart . 

Basically both the methods should work. We can check your code if it is not solving your problem.

you may have to ring buffer to receive the data through UART and the API to receive is wiced_uart_receive_bytes.

Thanks,

Rakesh B G

0 Likes