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

cross mob
lock attach
Attachments are accessible only for community members.
EvRe_4610981
Level 1
Level 1
Welcome!

Hi, I'm trying to run a snip example.bluetooth.serial_get_service from Wiced 6.4(win). But its coing to reset after 5seconds.. and does not start.

I chose the CYW94343WWCD1_EVB platform.

Next I run make snip.bluetooth.serial_gatt_service-CYW94343WWCD1_EVB download run JTAG=stm32f411blackpill JOBS=2»

The layout is based on boards

Type 1DX EVB ES2.0 (CYW4343W), BlackPILL (STM32F411CEU6), ST-Link_v2_1.

maket_Murata.jpg

In the USART1 terminal I see:

Platform CYW94343WWCD1_EVB initialised

Started ThreadX v5.8

WICED_core Initialized

00:00:00.012000 GKI_create_task func=0x8016ad5 id=1 name=BTU stack=0x0 stackSize=4096

00:00:00.020000 GKI_create_task func=0x80181e9 id=0 name=HCISU stack=0x0 stackSize=3072

In the USART2 terminal, a data packet is transmitted from the processor side

73 3c 56 04 00 90 f0 73 bb 00 00 26 5d 0d 00 10 s<V..ђрs»..&]...

01 0f 74 b0 57 04 00 8a f0 e3 bf 00 00 7a 07 0d ..t°W..Љргї..z..

00 10 01 0f 75 cc 2d 05 00 7d f0 d8 bc 00 00 80 ....uМ-..}рШј..Ђ

07 0d 00 10 01 0f 76 80 2a 03 00 9d f0 84 be 00 ......vЂ*..ќр„ѕ.

00 8c 07 0d 00 10 01 0f 77 54 a4 06 00 66 f0 ae .Њ......wT¤..fр®

b9 00 00 b4 07 0d 00 10 01 0f 78 14 69 05 00 79 №..ґ......x.i..y

f0 52 bf 00 00 bc 07 0d 00 10 01 0f 79 e8 70 07 рRї..ј......yиp.

00 59 f0 6c bb 00 00 c4 07 0d 00 10 01 0f 7a 84 .Yрl»..Д......z„

67 07 00 5a f0 26 b8 00 00 d4 07 0d 00 10 01 0f g..Zр&ё..Ф......

7b 54 2f 00 00 cd f0 46 bc 00 00 e4 07 0d 00 10 {T/..НрFј..д....

01 0f 7c e0 31 00 00 cd f0 04 bb 00 00 ec 07 0d ..|а1..Нр.»..м..

00 10 01 0f 7d fc b5 01 00 b5 f0 02 b9 00 00 04 ....}ьµ..µр.№...

08 0d 00 10 01 0f 7e fc c7 01 00 b4 f0 08 b8 00 ......~ьЗ..ґр.ё.

00 10 08 0d 00 10 01 0f 7f 64 c8 01 00 b3 f0 d9 ........dИ..ірЩ

bf 00 00 1a 08 0d 01 4c fc 1a 96 a1 21 00 00 10 ї......Lь.–Ў!...

01 0f 80 50 b4 01 00 b5 f0 ea b9 00 00 28 08 0d ..ЂPґ..µрк№..(..

00 fe 00 00 01 4e fc 04 ff ff ff ff .ю...Nь.яяяя 

01 03 0c 00 .... 

01 03 0c 00 .... 

01 03 0c 00 .... 

And then only the command to restart, but CYW4343W does not respond.

Then nothing happens in the USART1 terminal.

And in the USART2 terminal, STM32 sends the RESET command (01 03 0c 00) in a loop, but receives nothing in response.

In the file I changed ..\43xxx_Wi-Fi\platforms\CYW94343WWCD1_EVB\platform.cplatform.c

three pins BT_REG_ON, BT_DEV_WAKE, BT_HOST_WAKE and

/* Bluetooth UART pins. Used by libraries/bluetooth/internal/bus/UART/bt_bus.c */

static const platform_gpio_t internal_bt_uart_pins[] =

{

[WICED_BT_PIN_UART_TX ] = { GPIOA, 2 },

[WICED_BT_PIN_UART_RX ] = { GPIOA, 3 },

[WICED_BT_PIN_UART_CTS] = { GPIOA, 0 },

[WICED_BT_PIN_UART_RTS] = { GPIOA, 1 },

};

In USART2 the connection is as follows

What can I do and where to dig?

0 Likes
1 Solution

you need 26 MHz crystal to make the uart work correctly. That's important; otherwise you can try using HSI, instead of HSE (which is not really the recommended solution) in platform_config,h

/*  PLL source : external crystal */

#define PLL_SOURCE           ( RCC_PLLSource_HSI )

You don't need to change the buf_pools settings since the issue is happening prior to that.

View solution in original post

0 Likes
6 Replies
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

How have you configured the uart; i.e elements of wiced_bt_uart_config? I see that you have used a different UART port wrt the ones used by our default platform definitions (CYW94343WWCD1_EVB, BCM94343WWCD2). I am assuming that you have assigned correct DMA streams and corresponding irqs in the platform.c based on ST pinmux.

Seems like the initial HCI_Reset command is responded by CYW4343W but the later repeated resets are not being responded to.

Have you done any customization on top of the standard serial_gatt example? You can also go into debugger to check whether bt_stack_init is successful or not?

lock attach
Attachments are accessible only for community members.

Hello, thanks for answer!

I did not change default settings, like this:

/* Bluetooth UART configuration. Used by libraries/bluetooth/internal/bus/UART/bt_bus.c */

const platform_uart_config_t wiced_bt_uart_config =

{

    .baud_rate    = 115200,

    .data_width   = DATA_WIDTH_8BIT,

    .parity       = NO_PARITY,

    .stop_bits    = STOP_BITS_1,

    .flow_control = FLOW_CONTROL_CTS_RTS,

};

/* Bluetooth UART peripheral and runtime driver. Used by libraries/bluetooth/internal/bus/UART/bt_bus.c */

static const platform_uart_t internal_bt_uart_peripheral =

{

    .port               = USART2,

    .tx_pin             = &internal_bt_uart_pins[WICED_BT_PIN_UART_TX ],

    .rx_pin             = &internal_bt_uart_pins[WICED_BT_PIN_UART_RX ],

    .cts_pin            = &internal_bt_uart_pins[WICED_BT_PIN_UART_CTS],

    .rts_pin            = &internal_bt_uart_pins[WICED_BT_PIN_UART_RTS],

    .tx_dma_config =

    {

        .controller     = DMA1,

        .stream         = DMA1_Stream6,

        .channel        = DMA_Channel_4,

        .irq_vector     = DMA1_Stream6_IRQn,

        .complete_flags = DMA_HISR_TCIF6,

        .error_flags    = ( DMA_HISR_TEIF6 | DMA_HISR_FEIF6 ),

    },

    .rx_dma_config =

    {

        .controller     = DMA1,

        .stream         = DMA1_Stream5,

        .channel        = DMA_Channel_4,

        .irq_vector     = DMA1_Stream5_IRQn,

        .complete_flags = DMA_HISR_TCIF5,

        .error_flags    = ( DMA_HISR_TEIF5 | DMA_HISR_FEIF5 | DMA_HISR_DMEIF5 ),

    },

Do I need to change something in the settings of internal_bt_uart_peripheral?

Have you done any customization on top of the standard serial_gatt example? You can also go into debugger to check whether bt_stack_init is successful or not?

I did not do any customization in the listing.

0 Likes
EvRe_4610981
Level 1
Level 1
Welcome!

I'll lay out the connection diagram here. Is there something wrong with it?

DemoMurata_1DX_STM32F411_st-linkV2.png

0 Likes

The connection appears to be correct. Have you tried out any other ble/bt code example with this kit?

One additional recommendation to try out: since WICED uses Port D pins for BT uart, can you try using the same in your setup?

static const platform_gpio_t internal_bt_uart_pins[] =

{

    [WICED_BT_PIN_UART_TX ] = { GPIOD, 5 },

    [WICED_BT_PIN_UART_RX ] = { GPIOD, 6 },

    [WICED_BT_PIN_UART_CTS] = { GPIOD, 3 },

    [WICED_BT_PIN_UART_RTS] = { GPIOD, 4 },

};

RaktimR_11 написал(а):

The connection appears to be correct. Have you tried out any other ble/bt code example with this kit?

One additional recommendation to try out: since WICED uses Port D pins for BT uart, can you try using the same in your setup?

static const platform_gpio_t internal_bt_uart_pins[] =

{

    [WICED_BT_PIN_UART_TX ] = { GPIOD, 5 },

    [WICED_BT_PIN_UART_RX ] = { GPIOD, 6 },

    [WICED_BT_PIN_UART_CTS] = { GPIOD, 3 },

    [WICED_BT_PIN_UART_RTS] = { GPIOD, 4 },

};

Hello, RaktimR_11. Thanks for help.

The connection appears to be correct. Have you tried out any other ble/bt code example with this kit?

Yes, I tried another example. The result is the same.

At startup, messages in UART are issued:

Platform CYW94343WWCD1_EVB initialised

Started ThreadX v5.8

WICED_core Initialized

00:00:00.012000 GKI_create_task func=0x8016ad5 id=1 name=BTU stack=0x0 stackSize=4096

00:00:00.020000 GKI_create_task func=0x80181e9 id=0 name=HCISU stack=0x0 stackSize=3072

One additional recommendation to try out: since WICED uses Port D pins for BT uart, can you try using the same in your setup?

I can not use D port pins, because i have small package of chip.

It has no USART2 pins at port D. I have USART2 at port A only.

I have a slight difference in quartz. 25MHz instead 26MHz at CYW94343WWCD1_EVB.My_board_STM32F411CEU6-25MHz.pngCYW94343WWCD1_EVB-26MHz.png

I have changed code in CYW94343WWCD1_EVB.mk

# Global defines

# HSE_VALUE = STM32 crystal frequency = 26MHz (needed to make UART work correctly)

#GLOBAL_DEFINES += HSE_VALUE=26000000

GLOBAL_DEFINES += HSE_VALUE=25000000

GLOBAL_DEFINES += $$(if $$(NO_CRLF_STDIO_REPLACEMENT),,CRLF_STDIO_REPLACEMENT)

Where else should be corrected and is it critical in general?

I have pools in wiced_bt_cfg.c by default:

const wiced_bt_cfg_buf_pool_t wiced_bt_cfg_buf_pools[WICED_BT_CFG_NUM_BUF_POOLS] =

{

/*  { buf_size, buf_count } */

    { 64,       12   },     /* Small Buffer Pool */

    { 360,      6    },     /* Medium Buffer Pool (used for HCI & RFCOMM control messages, min recommended size is 360) */

    { 1056,     8    },     /* Large Buffer Pool  (used for HCI ACL messages) */

    { 1056,     5    },     /* Extra Large Buffer Pool - Used for avdt media packets and miscellaneous (if not needed, set buf_count to 0) */

};

Do I need to change?

And additional i have datasheet to my stm32 boarв MiniF4-STM32F4x1/MiniF4x1Cx_V30 SchDoc.pdf at master · WeActTC/MiniF4-STM32F4x1 · GitHub

0 Likes

you need 26 MHz crystal to make the uart work correctly. That's important; otherwise you can try using HSI, instead of HSE (which is not really the recommended solution) in platform_config,h

/*  PLL source : external crystal */

#define PLL_SOURCE           ( RCC_PLLSource_HSI )

You don't need to change the buf_pools settings since the issue is happening prior to that.

0 Likes