Skip to content

Add TARGET_STMBLUE #9491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e918624
Added TARGET_STMBLUE and BlueNRG2
ntoni92 Jan 24, 2019
516ac21
First working version of BlueNRG2-Cordio tested with HRM app. No RTOS…
ntoni92 Jan 24, 2019
c77d6cc
Added target BlueNRG2 to targets.json
ntoni92 Jan 24, 2019
64eddb6
Minor modification in BSS section initialization
ntoni92 Jan 28, 2019
b24863d
Fixed Static Random Address generation and initialization
ntoni92 Jan 28, 2019
e40b86e
Simplified Cordio RESET FSM (less number of states).
ntoni92 Jan 28, 2019
a51dc3f
Removed unused libraries. Imported sleep_api. Implemented (not yet
ntoni92 Jan 29, 2019
ab3968e
Errata corrige of previous commit.
ntoni92 Jan 29, 2019
aeae168
Fixed device_name in targets.json - removed informations about ARM an…
ntoni92 Feb 5, 2019
31838c1
Removed custom profile, but debug mode is not available due to a huge…
ntoni92 Feb 5, 2019
66c75c9
DTM name refactoring
ntoni92 Feb 5, 2019
3f40e5c
CLI correctly reports BlueNRG2 stack .text occupation.
ntoni92 Feb 5, 2019
0887553
Added BTLE_StackTick wrapper to avoid mbed_event_queue in transport l…
ntoni92 Feb 6, 2019
a35bd06
Removed unused files - revision of some comments - ADDED stub api hea…
ntoni92 Feb 13, 2019
031b012
Fixed advertising bug after reset
ntoni92 Feb 13, 2019
161de1d
merge from upstream/master
ntoni92 Mar 5, 2019
5f03f2f
Updated linker script (2 region model) - rebased HCI driver
ntoni92 Mar 5, 2019
a8bff18
Removed StackTick over HCI mechanism (not working)
ntoni92 Mar 5, 2019
c1f2717
Restoted optimized HCI driver - Added TICK_MS macro in targets.json
ntoni92 Mar 6, 2019
e23943e
Adding ARMC6 support
ntoni92 Mar 6, 2019
fa7ef1b
Added ARM scatter file
ntoni92 Mar 6, 2019
6488cbc
removed startup code includes - added support ARM in targets.json
ntoni92 Mar 7, 2019
af4720a
added TICK_MS define
ntoni92 Mar 7, 2019
e94d1a6
Merge remote-tracking branch 'upstream/master' into master-test
ntoni92 Mar 7, 2019
3e6d995
Added ARMc6 toolchain support and scatter file - still issued
ntoni92 Mar 7, 2019
a973b42
Start support ARMc6 toolchain - still not working
ntoni92 Mar 7, 2019
783c128
Include correction Ucase/Lcase - ARM compiler ifdef moved above (in c…
ntoni92 Mar 7, 2019
f9c1359
Merge branch 'master-test' of https://github.com/ntoni92/mbed-os-Blue…
ntoni92 Mar 8, 2019
8d51afa
Merge branch 'master-test' of https://github.com/ntoni92/mbed-os-Blue…
ntoni92 Mar 8, 2019
441b3ca
Fixed random address generation - defined serial library symbols
ntoni92 Mar 8, 2019
6fc549c
Added missing symbols in pinmap. (issued in ARMc6 compiler)
ntoni92 Mar 8, 2019
75ae503
ARMc6 memory aligned but not tested
ntoni92 Mar 8, 2019
8207df8
Starting adding SPI support
ntoni92 Mar 8, 2019
0bd8e3e
Starting adding SPI support (adding in targets.json)
ntoni92 Mar 8, 2019
0ac7b7a
Added licence headers (Apache 2.0 & SLA0068) - added license files (S…
ntoni92 Mar 11, 2019
1c9f37e
Updated License information.
ntoni92 Mar 11, 2019
5ba5b42
SPI not ready, removed definition in targets.json.
ntoni92 Mar 11, 2019
93794f6
updated CMSIS device_name
ntoni92 Mar 11, 2019
0e20e11
CR in liberty v2 license
ntoni92 Mar 13, 2019
229a1ef
compiler __weak redefined for ARMc6
ntoni92 Mar 13, 2019
8c53b88
Added IAR 8.32 support
ntoni92 Mar 15, 2019
a716762
updated iar8 linker script
ntoni92 Mar 15, 2019
78e329a
updated SLA0044
ntoni92 Mar 15, 2019
00c8114
removed cryptolib (controller basic configuration)
ntoni92 Mar 19, 2019
16db902
Starting SPI support
ntoni92 Mar 20, 2019
e9fad95
Working SPI master. Slave implemented but not tested.
ntoni92 Mar 22, 2019
95d9f00
Starting I2C support
ntoni92 Mar 22, 2019
ba01bea
I2C to be implemented.
ntoni92 Mar 26, 2019
64ff41f
merge spi develop
ntoni92 Apr 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ log
test_suite.json

# default delivery dir
DELIVERY/
DELIVERY/
326 changes: 326 additions & 0 deletions targets/TARGET_STMBLUE/Bluetooth_LE/inc/ble_status.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
/*
* Copyright (c) 2019 STMicroelectronics. All Rights Reserved.
*
* The information contained herein is property of STMicroelectronics.
* Terms and conditions of usage are described in detail in SOFTWARE
* LICENSE AGREEMENT:
*
* (SLA0068 - PRODUCTION LIMITED LICENSE AGREEMENT FOR ST MATERIALS)
*
* You may obtain a copy of the License here:
* LICENSE-SLA0068.txt and at STMicroelectronics website.
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
*/

#ifndef __BLE_STATUS_H__
#define __BLE_STATUS_H__

#include <bluenrg1_api.h>

/* @brief Standard Error Codes as specified by the Bluetooth Specifications
* Vol.2, Part D ("Error Codes").
* According to the spec the error codes range is from 0x00 to 0x3F.
*/
#define BLE_STATUS_SUCCESS ((tBleStatus)(0x00))

#define BLE_ERROR_UNKNOWN_HCI_COMMAND ((tBleStatus)(0x01))
#define BLE_ERROR_UNKNOWN_CONNECTION_ID ((tBleStatus)(0x02))

#define BLE_ERROR_HARDWARE_FAILURE ((tBleStatus)(0x03))

#define BLE_ERROR_AUTHENTICATION_FAILURE ((tBleStatus)(0x05))
#define BLE_ERROR_KEY_MISSING ((tBleStatus)(0x06))
#define BLE_ERROR_MEMORY_CAPACITY_EXCEEDED ((tBleStatus)(0x07))
#define BLE_ERROR_CONNECTION_TIMEOUT ((tBleStatus)(0x08))

#define BLE_ERROR_COMMAND_DISALLOWED ((tBleStatus)(0x0C))

#define BLE_ERROR_UNSUPPORTED_FEATURE ((tBleStatus)(0x11))

#define BLE_ERROR_INVALID_HCI_CMD_PARAMS ((tBleStatus)(0x12))

#define BLE_ERROR_TERMINATED_REMOTE_USER ((tBleStatus)(0x13))

#define BLE_ERROR_TERMINATED_LOCAL_HOST ((tBleStatus)(0x16))

#define BLE_ERROR_UNSUPP_RMT_FEATURE ((tBleStatus)(0x1A))

#define BLE_ERROR_UNSPECIFIED ((tBleStatus)(0x1F))

#define BLE_ERROR_PROCEDURE_TIMEOUT ((tBleStatus)(0x22))

#define BLE_ERROR_INSTANT_PASSED ((tBleStatus)(0x28))

#define BLE_ERROR_PARAMETER_OUT_OF_RANGE ((tBleStatus)(0x30))

#define BLE_ERROR_HOST_BUSY_PAIRING ((tBleStatus)(0x38))

#define BLE_ERROR_CONTROLLER_BUSY ((tBleStatus)(0x3A))

#define BLE_ERROR_DIRECTED_ADVERTISING_TIMEOUT ((tBleStatus)(0x3C))

#define BLE_ERROR_CONNECTION_END_WITH_MIC_FAILURE ((tBleStatus)(0x3D))
#define BLE_ERROR_CONNECTION_FAILED_TO_ESTABLISH ((tBleStatus)(0x3E))


/**
* @name Generic/System error codes
* @brief The error codes as reported by the different Protocol layers.
* They start with 0x40
* @{
*/

/**
* @brief The Connection Identifier does not exist.
* Temporary remapped to corresponding Controller Error.
*/
#define BLE_STATUS_UNKNOWN_CONNECTION_ID ((tBleStatus)(0x40))

/**
* @brief The Host failed while performing the requested operation.
*/
#define BLE_STATUS_FAILED ((tBleStatus)(0x41))

/*! @enum tBleStatus::BLE_STATUS_INVALID_PARAMS
*
*/
#define BLE_STATUS_INVALID_PARAMS ((tBleStatus)(0x42))

/**
* @brief The Host is already processing another request received in advance.
*/
#define BLE_STATUS_BUSY ((tBleStatus)(0x43))

/*
* Currently not used, because this error is always signalled with an explicit
* Error Response message seny by the relative layer.
*/
//#define BLE_STATUS_INVALID_LEN_PDU ((tBleStatus)(0x44))

/**
* @brief The operation requested cannot be completed immediately by the Host
* (usually because of lack of resources).
* The operation is generally put on hold by the caller and it's usually
* retried on later time.
*/
#define BLE_STATUS_PENDING ((tBleStatus)(0x45))

/**
* @brief The requested operation cannot be performed by the Host in the current status.
*/
#define BLE_STATUS_NOT_ALLOWED ((tBleStatus)(0x46))

/**
* @brief The requested operation violates the logic of the called layer/function or
* the format of the data to be processed during the operation.
*/
#define BLE_STATUS_ERROR ((tBleStatus)(0x47))

/**
* @brief The requested operation failed because of lack of memory.
* Out of memory shall be returned for situations where memory will never
* become available again (e.g. ATT database)
*/
#define BLE_STATUS_OUT_OF_MEMORY ((tBleStatus)(0x48))

/**
*@}
*/


/**
* @name L2CAP error codes
* @{
*/

/**
* @brief An invalid L2CAP CID/channel has been selected to send data over.
*/
#define BLE_STATUS_INVALID_CID ((tBleStatus)(0x50))

/**
*@}
*/


/**
* @name Security Manager error codes
* @brief Error codes returned by the Security Manager Protocol (SMP)
* @{
*/

/**
* @brief The remote device in in the Blacklist and the pairing operation it requested
* cannot be performed.
*/
#define BLE_STATUS_DEV_IN_BLACKLIST ((tBleStatus)(0x59))

/**
* @brief CSRK not found during validation of an incoming signed packet
*/
#define BLE_STATUS_CSRK_NOT_FOUND ((tBleStatus)(0x5A))

/**
* @brief Currently not used!
*/
#define BLE_STATUS_IRK_NOT_FOUND ((tBleStatus)(0x5B))

/**
* @brief A search for a specific remote device was unsuccessfull because no entry exists
* either into Security/GATT Database (flash-based) or in volatile database.
*/
#define BLE_STATUS_DEV_NOT_FOUND ((tBleStatus)(0x5C))

/**
* @brief The security database is full and no more records can be added.
*/
#define BLE_STATUS_SEC_DB_FULL ((tBleStatus)(0x5D))

/**
* @brief The remote device is not bonded, and no operations related to bonded devices
* may be performed (e.g. writing Gatt Client data).
*/
#define BLE_STATUS_DEV_NOT_BONDED ((tBleStatus)(0x5E))

/**
* @brief The encryption key size used for encrypting the link is insufficient\n
*/
#define BLE_INSUFFICIENT_ENC_KEYSIZE ((tBleStatus)(0x5F))

/**
*@}
*/


/**
* @name Gatt layer Error Codes
* @brief Error codes returned by the Gatt layer
* @{
*/
#define BLE_STATUS_INVALID_HANDLE ((tBleStatus)(0x60))

/**
* @brief There aren't sufficient Attributes handles available for allocation during
* creation of Services, Characteristics or Descriptors.
*/
#define BLE_STATUS_OUT_OF_HANDLE ((tBleStatus)(0x61))

/**
* @brief The requested GATT operation is not allowed in this context/status or using
* the provided parameters.
* This is a specific GATT error, different from generic Not Allowed error,
* because it refers to specific GATT specifications/rules.
*/
#define BLE_STATUS_INVALID_OPERATION ((tBleStatus)(0x62))

/**
* @brief The characteristic has already been added to the database.
*/
#define BLE_STATUS_CHARAC_ALREADY_EXISTS ((tBleStatus)(0x63))

/**
* @brief The requested operation failed for a temporary lack of resources
* (e.g. packet pool or timers), but it may be retried later when resources may
* become available (packets or timers may have been released by other consumers).
*/
#define BLE_STATUS_INSUFFICIENT_RESOURCES ((tBleStatus)(0x64))

/**
* @brief Notification/Indication can't be sent to the requested remote device because
* it doesn't satisfy the needed security permission.
*/
#define BLE_STATUS_SEC_PERMISSION_ERROR ((tBleStatus)(0x65))

/**
*@}
*/


/**
* @name GAP layer Error Codes
* @brief Error codes returned externally by the GAP layer
* @{
*/

/**
* @brief The address of the device could not be resolved using the IRK stored\n
*/
#define BLE_STATUS_ADDRESS_NOT_RESOLVED ((tBleStatus)(0x70))

/**
*@}
*/


/**
* @name Link Layer error Codes
* @brief Error codes returned by the Link layer during advertising/conection.
* @{
*/

/**
* @brief Returned when no valid slots are available (e.g. when there are no available state machines).
*/
#define BLE_STATUS_NO_VALID_SLOT ((tBleStatus)(0x82))

/**
* @brief Returned when a scan window shorter than minimum allowed value has been requested (i.e. 2ms)
*/
#define BLE_STATUS_SCAN_WINDOW_SHORT ((tBleStatus)(0x83))

/**
* @brief Returned when the maximum requested interval to be allocated is shorter then the current
* anchor period and a there is no submultiple for the current anchor period that is between
* the minimum and the maximum requested intervals.
*/
#define BLE_STATUS_NEW_INTERVAL_FAILED ((tBleStatus)(0x84))

/**
* @brief Returned when the maximum requested interval to be allocated is greater than the current anchor
* period, and there is no multiple of the anchor period that is between the minimum and the maximum
* requested intervals.
*/
#define BLE_STATUS_INTERVAL_TOO_LARGE ((tBleStatus)(0x85))

/**
* @brief Returned when the current anchor period or a new one can be found that is compatible to the
* interval range requested by the new slot, but the maximum available length that can be allocated is
* less than the minimum requested slot length.
*/
#define BLE_STATUS_LENGTH_FAILED ((tBleStatus)(0x86))

/**
*@}
*/

/**
* @name flash error codes
* @brief Flash sector read write error codes, which used to start with 0x49
* and are currently remapped from 0xFA to 0xFC
* @{
*/
#define FLASH_READ_FAILED ((tBleStatus)(0xFA))
#define FLASH_WRITE_FAILED ((tBleStatus)(0xFB))
#define FLASH_ERASE_FAILED ((tBleStatus)(0xFC))

/**
* @name Profiles Library Error Codes
* @{
*/
#define BLE_STATUS_TIMEOUT (0xFF)
#define BLE_STATUS_PROFILE_ALREADY_INITIALIZED (0xF0)
#define BLE_STATUS_NULL_PARAM (0xF1)

/**
*@}
*/


#endif
Loading