mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12394 from miteshdedhia7/pr/bug-fix-misc
Fix SDIO communication issue on Cypress 1M boards and other minor fixespull/12405/head
commit
88438dfd6c
|
@ -250,7 +250,9 @@ nsapi_error_t WhdSTAInterface::connect()
|
||||||
|
|
||||||
// initialize wiced, this is noop if already init
|
// initialize wiced, this is noop if already init
|
||||||
if (!_whd_emac.powered_up) {
|
if (!_whd_emac.powered_up) {
|
||||||
_whd_emac.power_up();
|
if(!_whd_emac.power_up()) {
|
||||||
|
return NSAPI_ERROR_DEVICE_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = whd_management_set_event_handler(_whd_emac.ifp, sta_link_change_events,
|
res = whd_management_set_event_handler(_whd_emac.ifp, sta_link_change_events,
|
||||||
|
@ -322,7 +324,9 @@ nsapi_error_t WhdSTAInterface::connect()
|
||||||
void WhdSTAInterface::wifi_on()
|
void WhdSTAInterface::wifi_on()
|
||||||
{
|
{
|
||||||
if (!_whd_emac.powered_up) {
|
if (!_whd_emac.powered_up) {
|
||||||
_whd_emac.power_up();
|
if(!_whd_emac.power_up()) {
|
||||||
|
CY_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,11 +388,14 @@ int8_t WhdSTAInterface::get_rssi()
|
||||||
|
|
||||||
// initialize wiced, this is noop if already init
|
// initialize wiced, this is noop if already init
|
||||||
if (!_whd_emac.powered_up) {
|
if (!_whd_emac.powered_up) {
|
||||||
_whd_emac.power_up();
|
if(!_whd_emac.power_up()) {
|
||||||
|
CY_ASSERT(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = (whd_result_t)whd_wifi_get_rssi(_whd_emac.ifp, &rssi);
|
res = (whd_result_t)whd_wifi_get_rssi(_whd_emac.ifp, &rssi);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
|
CY_ASSERT(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +470,9 @@ int WhdSTAInterface::internal_scan(WiFiAccessPoint *aps, unsigned count, scan_re
|
||||||
|
|
||||||
// initialize wiced, this is noop if already init
|
// initialize wiced, this is noop if already init
|
||||||
if (!_whd_emac.powered_up) {
|
if (!_whd_emac.powered_up) {
|
||||||
_whd_emac.power_up();
|
if(!_whd_emac.power_up()) {
|
||||||
|
return NSAPI_ERROR_DEVICE_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interal_scan_data.sema = new Semaphore();
|
interal_scan_data.sema = new Semaphore();
|
||||||
|
@ -476,7 +485,6 @@ int WhdSTAInterface::internal_scan(WiFiAccessPoint *aps, unsigned count, scan_re
|
||||||
whd_result_t whd_res;
|
whd_result_t whd_res;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|
||||||
whd_res = (whd_result_t)whd_wifi_scan(_whd_emac.ifp, WHD_SCAN_TYPE_ACTIVE, WHD_BSS_TYPE_ANY,
|
whd_res = (whd_result_t)whd_wifi_scan(_whd_emac.ifp, WHD_SCAN_TYPE_ACTIVE, WHD_BSS_TYPE_ANY,
|
||||||
NULL, NULL, NULL, NULL, whd_scan_handler, &internal_scan_result, &interal_scan_data);
|
NULL, NULL, NULL, NULL, whd_scan_handler, &internal_scan_result, &interal_scan_data);
|
||||||
if (whd_res != WHD_SUCCESS) {
|
if (whd_res != WHD_SUCCESS) {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -1080,7 +1080,12 @@ void SDIO_DisableSdClk(void)
|
||||||
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
||||||
{
|
{
|
||||||
uint16_t u16Div;
|
uint16_t u16Div;
|
||||||
u16Div = Cy_SysClk_ClkPeriGetFrequency() / u32SdClkFreqHz;
|
/*
|
||||||
|
* The UDB SDIO implemenation has a extra divider internally that divides the input clock to the UDB
|
||||||
|
* by 2. The desired clock frequency is hence intentionally multiplied by 2 in order to get the required
|
||||||
|
* SDIO operating frequency.
|
||||||
|
*/
|
||||||
|
u16Div = Cy_SysClk_ClkPeriGetFrequency() / (2 * u32SdClkFreqHz);
|
||||||
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -1080,7 +1080,12 @@ void SDIO_DisableSdClk(void)
|
||||||
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
||||||
{
|
{
|
||||||
uint16_t u16Div;
|
uint16_t u16Div;
|
||||||
u16Div = Cy_SysClk_ClkPeriGetFrequency() / u32SdClkFreqHz;
|
/*
|
||||||
|
* The UDB SDIO implemenation has a extra divider internally that divides the input clock to the UDB
|
||||||
|
* by 2. The desired clock frequency is hence intentionally multiplied by 2 in order to get the required
|
||||||
|
* SDIO operating frequency.
|
||||||
|
*/
|
||||||
|
u16Div = Cy_SysClk_ClkPeriGetFrequency() / (2 * u32SdClkFreqHz);
|
||||||
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -1080,7 +1080,12 @@ void SDIO_DisableSdClk(void)
|
||||||
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
||||||
{
|
{
|
||||||
uint16_t u16Div;
|
uint16_t u16Div;
|
||||||
u16Div = Cy_SysClk_ClkPeriGetFrequency() / u32SdClkFreqHz;
|
/*
|
||||||
|
* The UDB SDIO implemenation has a extra divider internally that divides the input clock to the UDB
|
||||||
|
* by 2. The desired clock frequency is hence intentionally multiplied by 2 in order to get the required
|
||||||
|
* SDIO operating frequency.
|
||||||
|
*/
|
||||||
|
u16Div = Cy_SysClk_ClkPeriGetFrequency() / (2 * u32SdClkFreqHz);
|
||||||
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@ -1080,7 +1080,12 @@ void SDIO_DisableSdClk(void)
|
||||||
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
void SDIO_SetSdClkFrequency(uint32_t u32SdClkFreqHz)
|
||||||
{
|
{
|
||||||
uint16_t u16Div;
|
uint16_t u16Div;
|
||||||
u16Div = Cy_SysClk_ClkPeriGetFrequency() / u32SdClkFreqHz;
|
/*
|
||||||
|
* The UDB SDIO implemenation has a extra divider internally that divides the input clock to the UDB
|
||||||
|
* by 2. The desired clock frequency is hence intentionally multiplied by 2 in order to get the required
|
||||||
|
* SDIO operating frequency.
|
||||||
|
*/
|
||||||
|
u16Div = Cy_SysClk_ClkPeriGetFrequency() / (2 * u32SdClkFreqHz);
|
||||||
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
Cy_SysClk_PeriphSetDivider(SDIO_HOST_Internal_Clock_DIV_TYPE, SDIO_HOST_Internal_Clock_DIV_NUM, (u16Div-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
********************************************************************************
|
********************************************************************************
|
||||||
* \copyright
|
* \copyright
|
||||||
* Copyright 2016-2019 Cypress Semiconductor Corporation
|
* Copyright 2016-2020 Cypress Semiconductor Corporation
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -13868,17 +13868,11 @@
|
||||||
"ANALOGOUT",
|
"ANALOGOUT",
|
||||||
"QSPI"
|
"QSPI"
|
||||||
],
|
],
|
||||||
"macros_remove": [
|
|
||||||
"MBEDTLS_CONFIG_HW_SUPPORT"
|
|
||||||
],
|
|
||||||
"extra_labels_add": [
|
"extra_labels_add": [
|
||||||
"PSOC6_01",
|
"PSOC6_01",
|
||||||
"MXCRYPTO_01",
|
"MXCRYPTO_01",
|
||||||
"CORDIO"
|
"CORDIO"
|
||||||
],
|
],
|
||||||
"extra_labels_remove": [
|
|
||||||
"MXCRYPTO"
|
|
||||||
],
|
|
||||||
"macros_add": [
|
"macros_add": [
|
||||||
"CY8C6247FDI_D52",
|
"CY8C6247FDI_D52",
|
||||||
"CYHAL_UDB_SDIO",
|
"CYHAL_UDB_SDIO",
|
||||||
|
|
Loading…
Reference in New Issue