Revert "Stop publish examples to mongoose repo"

This reverts commit 1a17e17c462bdd4e1d26d8742f8b7087273e04c2.

PUBLISHED_FROM=80028de308c9a021955d1425d2bfee8feb85f193
This commit is contained in:
Alexander Alashkin authored and Cesanta Bot committed 2017-02-06 14:08:59 +00:00
1 parent 7cc7df8c0e
commit eaef5bd133
351 files changed
+195424

No files matched your search

+579
View File
@@ -0,0 +1,579 @@
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
/* clang-format off */
/** @file
*
* @defgroup iot_sdk_tcp_server main.c
* @{
* @ingroup iot_sdk_app_lwip
* @brief This file contains the source code for LwIP TCP Server sample application.
*
*/
#include <stdbool.h>
#include <stdint.h>
#include "boards.h"
#include "app_timer_appsh.h"
#include "app_scheduler.h"
#include "app_button.h"
#include "nordic_common.h"
#include "softdevice_handler_appsh.h"
#include "ble_advdata.h"
#include "ble_srv_common.h"
#include "ble_ipsp.h"
#include "ble_6lowpan.h"
#include "mem_manager.h"
#include "app_trace.h"
/*
* arm-none-eabi-gcc has BYTE_ORDER already defined, so in order to avoid
* warnings in lwip, we have to undefine it
*
* TODO: Check if in the future versions of nRF5 SDK that changes.
* Current version of nRF51 SDK: 0.8.0
* nRF5 SDK: 0.9.0
*/
#undef BYTE_ORDER
#include "lwip/init.h"
#include "lwip/inet6.h"
#include "lwip/ip6.h"
#include "lwip/ip6_addr.h"
#include "lwip/netif.h"
/*lint -save -e607 */
#include "lwip/tcp.h"
/*lint -restore */
#include "lwip/timers.h"
#include "nrf_platform_port.h"
#include "app_util_platform.h"
#define DEVICE_NAME "LwIPTCPServer" /**< Device name used in BLE undirected advertisement. */
#define APP_TIMER_PRESCALER NRF51_DRIVER_TIMER_PRESCALER /**< Value of the RTC1 PRESCALER register. */
#define APP_TIMER_MAX_TIMERS 1 /**< Maximum number of simultaneously created timers. */
#define APP_TIMER_OP_QUEUE_SIZE 1
#define LWIP_SYS_TIMER_INTERVAL APP_TIMER_TICKS(250, APP_TIMER_PRESCALER) /**< Interval for timer used as trigger to send. */
#define SCHED_MAX_EVENT_DATA_SIZE 128 /**< Maximum size of scheduler events. */
#define SCHED_QUEUE_SIZE 12 /**< Maximum number of events in the scheduler queue. */
#define ADVERTISING_LED BSP_LED_0_MASK /**< Is on when device is advertising. */
#define CONNECTED_LED BSP_LED_1_MASK /**< Is on when device is connected. */
#define TCP_CONNECTED_LED BSP_LED_2_MASK /**< Is on when device is connected. */
#define DISPLAY_LED_0 BSP_LED_0_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_1 BSP_LED_1_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_2 BSP_LED_2_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_3 BSP_LED_3_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define ALL_APP_LED (BSP_LED_0_MASK | BSP_LED_1_MASK | \
BSP_LED_2_MASK | BSP_LED_3_MASK) /**< Define used for simultaneous operation of all application LEDs. */
#define APP_ADV_TIMEOUT 0 /**< Time for which the device must be advertising in non-connectable mode (in seconds). 0 disables timeout. */
#define APP_ADV_ADV_INTERVAL MSEC_TO_UNITS(100, UNIT_0_625_MS) /**< The advertising interval. This value can vary between 100ms to 10.24s). */
#define DEAD_BEEF 0xDEADBEEF /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
#define APPL_LOG app_trace_log /**< Macro for logging application messages on UART, in case ENABLE_DEBUG_LOG_SUPPORT is not defined, no logging occurs. */
#define APPL_DUMP app_trace_dump /**< Macro for dumping application data on UART, in case ENABLE_DEBUG_LOG_SUPPORT is not defined, no logging occurs. */
#define TCP_SERVER_PORT 9000 /**< TCP server listen port number. */
#define TCP_DATA_SIZE 8 /**< UDP Data size sent on remote. */
typedef enum
{
TCP_STATE_IDLE,
TCP_STATE_REQUEST_CONNECTION,
TCP_STATE_CONNECTED,
TCP_STATE_DATA_TX_IN_PROGRESS,
TCP_STATE_DISCONNECTED
}tcp_state_t;
eui64_t eui64_local_iid; /**< Local EUI64 value that is used as the IID for*/
static ble_gap_adv_params_t m_adv_params; /**< Parameters to be passed to the stack when starting advertising. */
static app_timer_id_t m_sys_timer_id; /**< System Timer used to service LwIP timers periodically. */
static struct tcp_pcb * mp_tcp_port; /**< TCP Port to listen on. */
static tcp_state_t m_tcp_state; /**< TCP State information. */
/**@brief Function for error handling, which is called when an error has occurred.
*
* @warning This handler is an example only and does not fit a final product. You need to analyse
* how your product is supposed to react in case of error.
*
* @param[in] error_code Error code supplied to the handler.
* @param[in] line_num Line number where the handler is called.
* @param[in] p_file_name Pointer to the file name.
*/
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name)
{
//Halt the application and notify of error using the LEDs.
APPL_LOG("[** ASSERT **]: Error 0x%08lX, Line %ld, File %s\r\n",error_code, line_num, p_file_name);
LEDS_ON(ALL_APP_LED);
for(;;)
{
}
// @note: In case on assert, it is desired to only recover and reset, uncomment the line below.
//NVIC_SystemReset();
}
/**@brief Callback function for asserts in the SoftDevice.
*
* @details This function will be called in case of an assert in the SoftDevice.
*
* @warning This handler is an example only and does not fit a final product. You need to analyse
* how your product is supposed to react in case of Assert.
* @warning On assert from the SoftDevice, the system can only recover on reset.
*
* @param[in] line_num Line number of the failing ASSERT call.
* @param[in] file_name File name of the failing ASSERT call.
*/
void assert_nrf_callback(uint16_t line_num, const uint8_t * p_file_name)
{
app_error_handler(DEAD_BEEF, line_num, p_file_name);
}
/**@brief Function for the LEDs initialization.
*
* @details Initializes all LEDs used by this application.
*/
static void leds_init(void)
{
// Configure application LED pins.
LEDS_CONFIGURE(ALL_APP_LED);
// Turn off all LED on initialization.
LEDS_OFF(ALL_APP_LED);
}
/**@brief Function for initializing the Advertising functionality.
*
* @details Encodes the required advertising data and passes it to the stack.
* Also builds a structure to be passed to the stack when starting advertising.
*/
static void advertising_init(void)
{
uint32_t err_code;
ble_advdata_t advdata;
uint8_t flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
ble_gap_conn_sec_mode_t sec_mode;
ble_gap_addr_t my_addr;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = sd_ble_gap_device_name_set(&sec_mode,
(const uint8_t *)DEVICE_NAME,
strlen(DEVICE_NAME));
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_address_get(&my_addr);
APP_ERROR_CHECK(err_code);
my_addr.addr[5] = 0x00;
my_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
err_code = sd_ble_gap_address_set(&my_addr);
APP_ERROR_CHECK(err_code);
IPV6_EUI64_CREATE_FROM_EUI48(eui64_local_iid.identifier,
my_addr.addr,
my_addr.addr_type);
ble_uuid_t adv_uuids[] =
{
{BLE_UUID_IPSP_SERVICE, BLE_UUID_TYPE_BLE}
};
//Build and set advertising data.
memset(&advdata, 0, sizeof(advdata));
advdata.name_type = BLE_ADVDATA_FULL_NAME;
advdata.flags = flags;
advdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
advdata.uuids_complete.p_uuids = adv_uuids;
err_code = ble_advdata_set(&advdata, NULL);
APP_ERROR_CHECK(err_code);
//Initialize advertising parameters (used when starting advertising).
memset(&m_adv_params, 0, sizeof(m_adv_params));
m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;
m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
m_adv_params.fp = BLE_GAP_ADV_FP_ANY;
m_adv_params.interval = APP_ADV_ADV_INTERVAL;
m_adv_params.timeout = APP_ADV_TIMEOUT;
}
/**@brief Function for starting advertising.
*/
static void advertising_start(void)
{
uint32_t err_code;
err_code = sd_ble_gap_adv_start(&m_adv_params);
APP_ERROR_CHECK(err_code);
LEDS_ON(ADVERTISING_LED);
}
/**@brief Function for handling the Application's BLE Stack events.
*
* @param[in] p_ble_evt Bluetooth stack event.
*/
static void on_ble_evt(ble_evt_t * p_ble_evt)
{
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
APPL_LOG ("[APPL]: Connected.\r\n");
break;
case BLE_GAP_EVT_DISCONNECTED:
APPL_LOG ("[APPL]: Disconnected.\r\n");
advertising_start();
break;
default:
break;
}
}
/**@brief Function for dispatching a BLE stack event to all modules with a BLE stack event handler.
*
* @details This function is called from the BLE Stack event interrupt handler after a BLE stack
* event has been received.
*
* @param[in] p_ble_evt Bluetooth stack event.
*/
static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
ble_ipsp_evt_handler(p_ble_evt);
on_ble_evt(p_ble_evt);
}
/**@brief Function for initializing the BLE stack.
*
* @details Initializes the SoftDevice and the BLE event interrupt.
*/
static void ble_stack_init(void)
{
uint32_t err_code;
// Initialize the SoftDevice handler module.
SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);
// Register with the SoftDevice handler module for BLE events.
err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
APP_ERROR_CHECK(err_code);
}
/**@brief Function for the Event Scheduler initialization.
*/
static void scheduler_init(void)
{
APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
}
/**@brief Function to TCP port.
*
* @details Function to close the TCP port and reset any information on the port.
*/
static void tcp_port_close(struct tcp_pcb * p_pcb)
{
m_tcp_state = TCP_STATE_REQUEST_CONNECTION;
//Reset all information set on and/or callback registered for the port.
tcp_arg(p_pcb, NULL);
tcp_sent(p_pcb, NULL);
tcp_recv(p_pcb, NULL);
tcp_err(p_pcb, NULL);
tcp_poll(p_pcb, NULL, 0);
UNUSED_VARIABLE(tcp_close(p_pcb));
LEDS_OFF((DISPLAY_LED_0 | DISPLAY_LED_1 | DISPLAY_LED_2 | DISPLAY_LED_3));
LEDS_ON(CONNECTED_LED);
}
/**@brief TCP Port Write complete callback.
*
* @details Calbback registered to be notified of the write complete event on the TCP port.
* In case write complete is notified with 'zero' length, port is closed.
*
* @param[in] p_arg Receive argument set on the port.
* @param[in] p_pcb PCB identifier of the port.
* @param[in] len Length of data written successfully.
*
* @retval ERR_OK.
*/
static err_t tcp_write_complete(void * p_arg,
struct tcp_pcb * p_pcb,
u16_t len)
{
UNUSED_PARAMETER(p_arg);
UNUSED_PARAMETER(p_pcb);
if (len != 0)
{
//Write complete, reset the state to connected from transmit pending.
m_tcp_state = TCP_STATE_CONNECTED;
}
else
{
//Something is not right on the port, close the port.
tcp_port_close(mp_tcp_port);
}
return ERR_OK;
}
/**@brief Send test data on the port.
*
* @details Sends TCP data in Request of size 8 in format described in description above.
*
* @param[in] p_pcb PCB identifier of the port.
*/
static void tcp_send_data(struct tcp_pcb * p_pcb, uint32_t sequence_number)
{
err_t err = ERR_OK;
if (m_tcp_state != TCP_STATE_DATA_TX_IN_PROGRESS)
{
//Register callback to get notification of data reception is complete.
tcp_sent(p_pcb, tcp_write_complete);
uint8_t tcp_data[TCP_DATA_SIZE];
tcp_data[0] = (uint8_t )((sequence_number >> 24) & 0x000000FF);
tcp_data[1] = (uint8_t )((sequence_number >> 16) & 0x000000FF);
tcp_data[2] = (uint8_t )((sequence_number >> 8) & 0x000000FF);
tcp_data[3] = (uint8_t )(sequence_number & 0x000000FF);
tcp_data[4] = 'P';
tcp_data[5] = 'o';
tcp_data[6] = 'n';
tcp_data[7] = 'g';
//Enqueue data for transmission.
err = tcp_write(p_pcb, tcp_data, TCP_DATA_SIZE, 1);
if (err != ERR_OK)
{
APPL_LOG ("[APPL]: Failed to send TCP packet, reason %d\r\n", err);
}
else
{
m_tcp_state = TCP_STATE_DATA_TX_IN_PROGRESS;
}
}
else
{
//Wait for tx to be complete.
}
}
/**@brief Callback registered for receiving data on the TCP Port.
*
* @param[in] p_arg Receive argument set on the TCP port.
* @param[in] p_pcb TCP PCB on which data is received.
* @param[in] p_buffer Buffer with received data.
* @param[in] err Event result indicating error associated with the receive,
* if any, else ERR_OK.
*/
err_t tcp_recv_data_handler(void * p_arg,
struct tcp_pcb * p_pcb,
struct pbuf * p_buffer,
err_t err)
{
APPL_LOG ("[APPL]: >> TCP Data.\r\n");
//Check event result before proceeding.
if (err == ERR_OK)
{
uint8_t *p_data = p_buffer->payload;
if (p_buffer->len == TCP_DATA_SIZE)
{
uint32_t sequence_number = 0;
sequence_number = ((p_data[0] << 24) & 0xFF000000);
sequence_number |= ((p_data[1] << 16) & 0x00FF0000);
sequence_number |= ((p_data[2] << 8) & 0x0000FF00);
sequence_number |= (p_data[3] & 0x000000FF);
LEDS_OFF(ALL_APP_LED);
if (sequence_number & 0x00000001)
{
LEDS_ON(DISPLAY_LED_0);
}
if (sequence_number & 0x00000002)
{
LEDS_ON(DISPLAY_LED_1);
}
if (sequence_number & 0x00000004)
{
LEDS_ON(DISPLAY_LED_2);
}
if (sequence_number & 0x00000008)
{
LEDS_ON(DISPLAY_LED_3);
}
//Send Response
tcp_send_data(p_pcb, sequence_number);
}
else
{
APPL_LOG ("[APPL]: TCP data received in incorrect format.\r\n");
}
// All is good with the data received, process it.
tcp_recved(p_pcb, p_buffer->tot_len);
UNUSED_VARIABLE(pbuf_free(p_buffer));
}
else
{
//Free the buffer in case its not NULL.
if (p_buffer != NULL)
{
UNUSED_VARIABLE(pbuf_free(p_buffer));
}
//Something is not right with the port, close the port.
tcp_port_close(mp_tcp_port);
}
return ERR_OK;
}
/**@brief Function for initializing IP stack.
*
* @details Initialize the IP Stack and its driver.
*/
static void ip_stack_init(void)
{
uint32_t err_code = nrf51_sdk_mem_init();
APP_ERROR_CHECK(err_code);
//Initialize LwIP stack.
lwip_init();
//Initialize LwIP stack driver.
err_code = nrf51_driver_init();
APP_ERROR_CHECK(err_code);
}
/**@brief Timer callback used for periodic servicing of LwIP protocol timers.
*
* @details Timer callback used for periodic servicing of LwIP protocol timers.
*
* @param[in] p_context Pointer used for passing context. No context used in this application.
*/
static void system_timer_callback(void * p_context)
{
UNUSED_VARIABLE(p_context);
sys_check_timeouts();
}
/**@brief Function for the Timer initialization.
*
* @details Initializes the timer module. This creates and starts application timers.
*/
static void timers_init(void)
{
uint32_t err_code;
// Initialize timer module.
APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);
// Create timers.
err_code = app_timer_create(&m_sys_timer_id,
APP_TIMER_MODE_REPEATED,
system_timer_callback);
APP_ERROR_CHECK(err_code);
}
/**@brief Function to handle interface up event. */
void nrf51_driver_interface_up(void)
{
uint32_t err_code;
APPL_LOG ("[APPL]: IPv6 interface up.\r\n");
sys_check_timeouts();
m_tcp_state = TCP_STATE_REQUEST_CONNECTION;
err_code = app_timer_start(m_sys_timer_id, LWIP_SYS_TIMER_INTERVAL, NULL);
APP_ERROR_CHECK(err_code);
LEDS_OFF(ADVERTISING_LED);
LEDS_ON(CONNECTED_LED);
}
/**@brief Function to handle interface down event. */
void nrf51_driver_interface_down(void)
{
uint32_t err_code;
APPL_LOG ("[APPL]: IPv6 interface down.\r\n");
err_code = app_timer_stop(m_sys_timer_id);
APP_ERROR_CHECK(err_code);
LEDS_OFF((DISPLAY_LED_0 | DISPLAY_LED_1 | DISPLAY_LED_2 | DISPLAY_LED_3));
LEDS_ON(ADVERTISING_LED);
m_tcp_state = TCP_STATE_DISCONNECTED;
}
void bleconfig_init(void) {
//Initialize.
app_trace_init();
leds_init();
timers_init();
ble_stack_init();
advertising_init();
ip_stack_init ();
scheduler_init();
APPL_LOG ("\r\n");
APPL_LOG ("[APPL]: Init done.\r\n");
//Start execution.
advertising_start();
}
void bleconfig_poll(void) {
//Execute event schedule.
app_sched_execute();
}
+7
View File
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
*/
void bleconfig_init(void);
void bleconfig_poll(void);
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectGui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_guix.xsd">
<SchemaVersion>-5.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<ViewPool/>
<MDIGroups>
<Orientation>1</Orientation>
<ActiveMDIGroup>0</ActiveMDIGroup>
<MDIGroup>
<Size>100</Size>
<ActiveTab>0</ActiveTab>
<Doc>
<Name>..\..\..\..\..\..\..\components\softdevice\s1xx_iot\doc\s1xx-iot-prototype2_licence_agreement.txt</Name>
<ColumnNumber>0</ColumnNumber>
<TopLine>1</TopLine>
<CurrentLine>1</CurrentLine>
<Folding>1</Folding>
<ContractedFolders></ContractedFolders>
<PaneID>0</PaneID>
</Doc>
</MDIGroup>
</MDIGroups>
</ProjectGui>
@@ -0,0 +1,725 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
</Extensions>
<DaveTm>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DaveTm>
<Target>
<TargetName>nrf51422_xxac_s1xx_iot</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>16000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
<FlashByte>65535</FlashByte>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
</OPTHX>
<OPTLEX>
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\_build\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
<CreateAListing>1</CreateAListing>
<CreateLListing>1</CreateLListing>
<CreateIListing>0</CreateIListing>
<AsmCond>1</AsmCond>
<AsmSymb>1</AsmSymb>
<AsmXref>0</AsmXref>
<CCond>1</CCond>
<CCode>0</CCode>
<CListInc>0</CListInc>
<CSymb>0</CSymb>
<LinkerCodeListing>0</LinkerCodeListing>
</ListingPage>
<OPTXL>
<LMap>1</LMap>
<LComments>1</LComments>
<LGenerateSymbols>1</LGenerateSymbols>
<LLibSym>1</LLibSym>
<LLines>1</LLines>
<LLocSym>1</LLocSym>
<LPubSym>1</LPubSym>
<LXref>0</LXref>
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>5</CpuCode>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<sLdApp>1</sLdApp>
<sGomain>1</sGomain>
<sRbreak>1</sRbreak>
<sRwatch>1</sRwatch>
<sRmem>1</sRmem>
<sRfunc>1</sRfunc>
<sRbox>1</sRbox>
<tLdApp>1</tLdApp>
<tGomain>1</tGomain>
<tRbreak>1</tRbreak>
<tRwatch>1</tRwatch>
<tRmem>1</tRmem>
<tRfunc>0</tRfunc>
<tRbox>1</tRbox>
<tRtrace>0</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>6</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U408001579 -O78 -S0 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0nrf51xxx.flm -FS00 -FL0200000 -FP0($$Device:nRF51822_xxAA$Flash\nrf51xxx.flm)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0nrf51xxx -FS00 -FL0200000 -FP0($$Device:nRF51822_xxAA$Flash\nrf51xxx.flm))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>0</periodic>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>0</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
<AscS1>0</AscS1>
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
</TargetOption>
</Target>
<Group>
<GroupName>Application</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\main.c</PathWithFileName>
<FilenameWithoutPath>main.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\bleconfig.c</PathWithFileName>
<FilenameWithoutPath>bleconfig.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\bleconfig.h</PathWithFileName>
<FilenameWithoutPath>bleconfig.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\myboard.h</PathWithFileName>
<FilenameWithoutPath>myboard.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Documentation</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\Abstract.txt</PathWithFileName>
<FilenameWithoutPath>Abstract.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\license.txt</PathWithFileName>
<FilenameWithoutPath>license.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Third Parties</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>7</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\external\lwip\lib\liblwip.lib</PathWithFileName>
<FilenameWithoutPath>liblwip.lib</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>3</GroupNumber>
<FileNumber>8</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\external\lwip\src\port\nrf_platform_port.c</PathWithFileName>
<FilenameWithoutPath>nrf_platform_port.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>nRF_BLE</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>9</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\ble\common\ble_advdata.c</PathWithFileName>
<FilenameWithoutPath>ble_advdata.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>10</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\ble\common\ble_srv_common.c</PathWithFileName>
<FilenameWithoutPath>ble_srv_common.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>nRF_Drivers</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>11</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\uart\app_uart_fifo.c</PathWithFileName>
<FilenameWithoutPath>app_uart_fifo.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>12</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\hal\nrf_delay.c</PathWithFileName>
<FilenameWithoutPath>nrf_delay.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>13</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\common\nrf_drv_common.c</PathWithFileName>
<FilenameWithoutPath>nrf_drv_common.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>14</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\gpiote\nrf_drv_gpiote.c</PathWithFileName>
<FilenameWithoutPath>nrf_drv_gpiote.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>nRF_IoT</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>15</FileNumber>
<FileType>4</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\iot\ble_6lowpan\lib\ble_6lowpan.lib</PathWithFileName>
<FilenameWithoutPath>ble_6lowpan.lib</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>6</GroupNumber>
<FileNumber>16</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\iot\context_manager\iot_context_manager.c</PathWithFileName>
<FilenameWithoutPath>iot_context_manager.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>nRF_Libraries</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>17</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\button\app_button.c</PathWithFileName>
<FilenameWithoutPath>app_button.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>18</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\util\app_error.c</PathWithFileName>
<FilenameWithoutPath>app_error.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>19</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\fifo\app_fifo.c</PathWithFileName>
<FilenameWithoutPath>app_fifo.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>20</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\scheduler\app_scheduler.c</PathWithFileName>
<FilenameWithoutPath>app_scheduler.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>21</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\timer\app_timer.c</PathWithFileName>
<FilenameWithoutPath>app_timer.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>22</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\timer\app_timer_appsh.c</PathWithFileName>
<FilenameWithoutPath>app_timer_appsh.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>23</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\trace\app_trace.c</PathWithFileName>
<FilenameWithoutPath>app_trace.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>24</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\mem_manager\mem_manager.c</PathWithFileName>
<FilenameWithoutPath>mem_manager.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>7</GroupNumber>
<FileNumber>25</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\libraries\util\nrf_assert.c</PathWithFileName>
<FilenameWithoutPath>nrf_assert.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>nRF_SoftDevice</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>26</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\softdevice\s1xx_iot\doc\s1xx-iot-prototype2_licence_agreement.txt</PathWithFileName>
<FilenameWithoutPath>s1xx-iot-prototype2_licence_agreement.txt</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\softdevice\common\softdevice_handler\softdevice_handler.c</PathWithFileName>
<FilenameWithoutPath>softdevice_handler.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\nrf51_iot_sdk\components\softdevice\common\softdevice_handler\softdevice_handler_appsh.c</PathWithFileName>
<FilenameWithoutPath>softdevice_handler_appsh.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Mongoose</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>9</GroupNumber>
<FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\..\mongoose.c</PathWithFileName>
<FilenameWithoutPath>mongoose.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>RTT</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\rtt\RTT\SEGGER_RTT.c</PathWithFileName>
<FilenameWithoutPath>SEGGER_RTT.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>31</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\rtt\RTT\SEGGER_RTT.h</PathWithFileName>
<FilenameWithoutPath>SEGGER_RTT.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>32</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\rtt\RTT\SEGGER_RTT_Conf.h</PathWithFileName>
<FilenameWithoutPath>SEGGER_RTT_Conf.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>33</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\rtt\RTT\SEGGER_RTT_printf.c</PathWithFileName>
<FilenameWithoutPath>SEGGER_RTT_printf.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>10</GroupNumber>
<FileNumber>34</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\rtt\Syscalls\RTT_Syscalls_KEIL.c</PathWithFileName>
<FilenameWithoutPath>RTT_Syscalls_KEIL.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>
<Group>
<GroupName>::Device</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>35</FileNumber>
<FileType>2</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>RTE\Device\nRF51422_xxAC\arm_startup_nrf51.s</PathWithFileName>
<FilenameWithoutPath>arm_startup_nrf51.s</FilenameWithoutPath>
<RteFlg>1</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>12</GroupNumber>
<FileNumber>36</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>RTE\Device\nRF51422_xxAC\system_nrf51.c</PathWithFileName>
<FilenameWithoutPath>system_nrf51.c</FilenameWithoutPath>
<RteFlg>1</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>
@@ -0,0 +1,701 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>nrf51422_xxac_s1xx_iot</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<TargetCommonOption>
<Device>nRF51422_xxAC</Device>
<Vendor>Nordic Semiconductor</Vendor>
<PackID>NordicSemiconductor.nRF_DeviceFamilyPack.8.0.5</PackID>
<PackURL>http://developer.nordicsemi.com/nRF51_SDK/pieces/nRF_DeviceFamilyPack/</PackURL>
<Cpu>IROM(0x00000000,0x40000) IRAM(0x20000000,0x8000) CPUTYPE("Cortex-M0") CLOCK(16000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>UL2CM3(-UM0049BUE -O4175 -S0 -C0 -N00("ARM CoreSight SW-DP") -D00(0BB11477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0nRF5Prog -FS00 -FL08000)</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>core.h</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>..\..\..\..\..\..\..\SVD\nrf51.xml</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
<ButtonStop>0</ButtonStop>
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\_build\</OutputDirectory>
<OutputName>nrf51422_xxac_s1xx_iot</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\_build\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>0</AlwaysBuild>
<GenerateAssemblyFile>0</GenerateAssemblyFile>
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName></SimDllName>
<SimDllArguments></SimDllArguments>
<SimDlgDll></SimDlgDll>
<SimDlgDllArguments></SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments></TargetDllArguments>
<TargetDlgDll>TARMCM1.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM0</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
<HexSelection>1</HexSelection>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
<Simulator>
<UseSimulator>0</UseSimulator>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
<RestoreSysVw>1</RestoreSysVw>
</Simulator>
<Target>
<UseTarget>1</UseTarget>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<RestoreTracepoints>0</RestoreTracepoints>
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>6</TargetSelection>
<SimDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
</SimDlls>
<TargetDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
<Driver>Segger\JL2CM3.dll</Driver>
</TargetDlls>
</DebugOption>
<Utilities>
<Flash1>
<UseTargetDll>1</UseTargetDll>
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>4099</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>Segger\JL2CM3.dll</Flash2>
<Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
<ArmAdsMisc>
<GenerateListings>0</GenerateListings>
<asHll>1</asHll>
<asAsm>1</asAsm>
<asMacX>1</asMacX>
<asSyms>1</asSyms>
<asFals>1</asFals>
<asDbgD>1</asDbgD>
<asForm>1</asForm>
<ldLst>0</ldLst>
<ldmm>1</ldmm>
<ldXref>1</ldXref>
<BigEnd>0</BigEnd>
<AdsALst>1</AdsALst>
<AdsACrf>1</AdsACrf>
<AdsANop>0</AdsANop>
<AdsANot>0</AdsANot>
<AdsLLst>1</AdsLLst>
<AdsLmap>1</AdsLmap>
<AdsLcgr>1</AdsLcgr>
<AdsLsym>1</AdsLsym>
<AdsLszi>1</AdsLszi>
<AdsLtoi>1</AdsLtoi>
<AdsLsun>1</AdsLsun>
<AdsLven>1</AdsLven>
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M0"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
<hadIROM>1</hadIROM>
<hadIRAM>1</hadIRAM>
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<RoSelD>3</RoSelD>
<RwSelD>5</RwSelD>
<CodeSel>0</CodeSel>
<OptFeed>0</OptFeed>
<NoZi1>0</NoZi1>
<NoZi2>0</NoZi2>
<NoZi3>0</NoZi3>
<NoZi4>0</NoZi4>
<NoZi5>0</NoZi5>
<Ro1Chk>0</Ro1Chk>
<Ro2Chk>0</Ro2Chk>
<Ro3Chk>0</Ro3Chk>
<Ir1Chk>1</Ir1Chk>
<Ir2Chk>0</Ir2Chk>
<Ra1Chk>0</Ra1Chk>
<Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk>
<Im1Chk>1</Im1Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories>
<Ocm1>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm1>
<Ocm2>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm2>
<Ocm3>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm5>
<Ocm6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x8000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x40000</Size>
</IROM>
<XRAM>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x18000</StartAddress>
<Size>0x28000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT5>
<OCR_RVCT6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT6>
<OCR_RVCT7>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT7>
<OCR_RVCT8>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20002000</StartAddress>
<Size>0x6000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>4</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
<Strict>0</Strict>
<EnumInt>0</EnumInt>
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>0</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>0</uC99>
<useXO>0</useXO>
<VariousControls>
<MiscControls>--c99</MiscControls>
<Define>__HEAP_SIZE=1024 BOARD_PCA10028 BLE_STACK_SUPPORT_REQD S110 BSP_DEFINES_ONLY NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0 MG_DISABLE_HTTP_DIGEST_AUTH MG_DISABLE_MD5 MG_DISABLE_HTTP_KEEP_ALIVE MG_ENABLE_HTTP_SSI=0 MG_ENABLE_HTTP_STREAMING_MULTIPART CS_PLATFORM=CS_P_NRF51 CS_ENABLE_STDIO NRF_LOG_USES_RTT ENABLE_DEBUG_LOG_SUPPORT</Define>
<Undefine></Undefine>
<IncludePath>..\..\..\config;..\..\..;..\..\..\..\nrf51_iot_sdk\examples\bsp;..\..\..\..\nrf51_iot_sdk\components\softdevice\s1xx_iot\headers;..\..\..\..\nrf51_iot_sdk\components\ble\common;..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\uart;..\..\..\..\nrf51_iot_sdk\components\libraries\timer;..\..\..\..\nrf51_iot_sdk\components\softdevice\common\softdevice_handler;..\..\..\..\nrf51_iot_sdk\components\libraries\scheduler;..\..\..\..\nrf51_iot_sdk\components\libraries\button;..\..\..\..\nrf51_iot_sdk\external\lwip\src\include;..\..\..\..\nrf51_iot_sdk\external\lwip\src\include\netif;..\..\..\..\nrf51_iot_sdk\external\lwip\src\port;..\..\..\..\nrf51_iot_sdk\external\lwip\src\port\arch;..\..\..\..\nrf51_iot_sdk\components\iot\ble_6lowpan;..\..\..\..\nrf51_iot_sdk\components\device;..\..\..\..\nrf51_iot_sdk\components\toolchain;..\..\..\..\nrf51_iot_sdk\components\libraries\util;..\..\..\..\nrf51_iot_sdk\components\libraries\fifo;..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\gpiote;..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\config;..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\common;..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\hal;..\..\..\..\nrf51_iot_sdk\components\libraries\mem_manager;..\..\..\..\nrf51_iot_sdk\components\iot\include;..\..\..\..\nrf51_iot_sdk\components\iot\context_manager;..\..\..\..\nrf51_iot_sdk\components\iot\ble_ipsp;..\..\..\..\nrf51_iot_sdk\components\libraries\trace;..\..\..\..\..\..;..\..\..\rtt\RTT</IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<VariousControls>
<MiscControls></MiscControls>
<Define>__HEAP_SIZE=1024 BOARD_PCA10028 BLE_STACK_SUPPORT_REQD S110 BSP_DEFINES_ONLY NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0 NRF_LOG_USES_RTT ENABLE_DEBUG_LOG_SUPPORT</Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
<umfTarg>1</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange>0x00000000</TextAddressRange>
<DataAddressRange>0x00000000</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile></ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>Application</GroupName>
<Files>
<File>
<FileName>main.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\main.c</FilePath>
</File>
<File>
<FileName>bleconfig.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\bleconfig.c</FilePath>
</File>
<File>
<FileName>bleconfig.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\bleconfig.h</FilePath>
</File>
<File>
<FileName>myboard.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\myboard.h</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>Documentation</GroupName>
<Files>
<File>
<FileName>Abstract.txt</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\Abstract.txt</FilePath>
</File>
<File>
<FileName>license.txt</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\license.txt</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>Third Parties</GroupName>
<Files>
<File>
<FileName>liblwip.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\external\lwip\lib\liblwip.lib</FilePath>
</File>
<File>
<FileName>nrf_platform_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\external\lwip\src\port\nrf_platform_port.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nRF_BLE</GroupName>
<Files>
<File>
<FileName>ble_advdata.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\ble\common\ble_advdata.c</FilePath>
</File>
<File>
<FileName>ble_srv_common.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\ble\common\ble_srv_common.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nRF_Drivers</GroupName>
<Files>
<File>
<FileName>app_uart_fifo.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\uart\app_uart_fifo.c</FilePath>
</File>
<File>
<FileName>nrf_delay.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\hal\nrf_delay.c</FilePath>
</File>
<File>
<FileName>nrf_drv_common.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\common\nrf_drv_common.c</FilePath>
</File>
<File>
<FileName>nrf_drv_gpiote.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\drivers_nrf\gpiote\nrf_drv_gpiote.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nRF_IoT</GroupName>
<Files>
<File>
<FileName>ble_6lowpan.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\iot\ble_6lowpan\lib\ble_6lowpan.lib</FilePath>
</File>
<File>
<FileName>iot_context_manager.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\iot\context_manager\iot_context_manager.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nRF_Libraries</GroupName>
<Files>
<File>
<FileName>app_button.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\button\app_button.c</FilePath>
</File>
<File>
<FileName>app_error.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\util\app_error.c</FilePath>
</File>
<File>
<FileName>app_fifo.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\fifo\app_fifo.c</FilePath>
</File>
<File>
<FileName>app_scheduler.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\scheduler\app_scheduler.c</FilePath>
</File>
<File>
<FileName>app_timer.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\timer\app_timer.c</FilePath>
</File>
<File>
<FileName>app_timer_appsh.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\timer\app_timer_appsh.c</FilePath>
</File>
<File>
<FileName>app_trace.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\trace\app_trace.c</FilePath>
</File>
<File>
<FileName>mem_manager.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\mem_manager\mem_manager.c</FilePath>
</File>
<File>
<FileName>nrf_assert.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\libraries\util\nrf_assert.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>nRF_SoftDevice</GroupName>
<Files>
<File>
<FileName>s1xx-iot-prototype2_licence_agreement.txt</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\softdevice\s1xx_iot\doc\s1xx-iot-prototype2_licence_agreement.txt</FilePath>
</File>
<File>
<FileName>softdevice_handler.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\softdevice\common\softdevice_handler\softdevice_handler.c</FilePath>
</File>
<File>
<FileName>softdevice_handler_appsh.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\nrf51_iot_sdk\components\softdevice\common\softdevice_handler\softdevice_handler_appsh.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>Mongoose</GroupName>
<Files>
<File>
<FileName>mongoose.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\..\mongoose.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>RTT</GroupName>
<Files>
<File>
<FileName>SEGGER_RTT.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\rtt\RTT\SEGGER_RTT.c</FilePath>
</File>
<File>
<FileName>SEGGER_RTT.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\rtt\RTT\SEGGER_RTT.h</FilePath>
</File>
<File>
<FileName>SEGGER_RTT_Conf.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\rtt\RTT\SEGGER_RTT_Conf.h</FilePath>
</File>
<File>
<FileName>SEGGER_RTT_printf.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\rtt\RTT\SEGGER_RTT_printf.c</FilePath>
</File>
<File>
<FileName>RTT_Syscalls_KEIL.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\rtt\Syscalls\RTT_Syscalls_KEIL.c</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
<Group>
<GroupName>::Device</GroupName>
<Files>
<File>
<FileName>arm_startup_nrf51.s</FileName>
<FileType>2</FileType>
<FilePath>RTE\Device\nRF51422_xxAC\arm_startup_nrf51.s</FilePath>
</File>
<File>
<FileName>system_nrf51.c</FileName>
<FileType>1</FileType>
<FilePath>RTE\Device\nRF51422_xxAC\system_nrf51.c</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
<RTE>
<packages>
<filter>
<targetInfos/>
</filter>
<package name="CMSIS" schemaVersion="1.2" url="http://www.keil.com/pack/" vendor="ARM" version="4.2.0">
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</package>
<package name="nRF_DeviceFamilyPack" schemaVersion="1.0" url="http://developer.nordicsemi.com/nRF51_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="7.2.1">
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</package>
</packages>
<apis/>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="3.40.0" condition="CMSIS Core">
<package name="CMSIS" schemaVersion="1.2" url="http://www.keil.com/pack/" vendor="ARM" version="4.2.0"/>
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</component>
<component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="7.2.1" condition="nRF51 Series CMSIS Device">
<package name="nRF_DeviceFamilyPack" schemaVersion="1.0" url="http://developer.nordicsemi.com/nRF51_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="7.2.1"/>
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</component>
</components>
<files>
<file attr="config" category="source" condition="ARM Compiler" name="Device\Source\arm\arm_startup_nrf51.s">
<instance index="0">RTE\Device\nRF51422_xxAC\arm_startup_nrf51.s</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.0.5" condition="nRF51 Series CMSIS Device"/>
<package license="License\license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF51_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.0.5"/>
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</file>
<file attr="config" category="source" name="Device\Source\system_nrf51.c">
<instance index="0">RTE\Device\nRF51422_xxAC\system_nrf51.c</instance>
<component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.0.5" condition="nRF51 Series CMSIS Device"/>
<package license="License\license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF51_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.0.5"/>
<targetInfos>
<targetInfo name="nrf51422_xxac_s1xx_iot"/>
</targetInfos>
</file>
</files>
</RTE>
</Project>
@@ -0,0 +1,2 @@
target extended-remote localhost:2331
file _build/nrf51422_xxac_s1xx_iot.out
@@ -0,0 +1,273 @@
PROJECT_NAME := iot_lwip_tcp_server_pca10028
export OUTPUT_FILENAME
#MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
MAKEFILE_NAME := $(MAKEFILE_LIST)
MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
TEMPLATE_PATH = ../../../../nrf51_iot_sdk/components/toolchain/gcc
ifeq ($(OS),Windows_NT)
include $(TEMPLATE_PATH)/Makefile.windows
else
include $(TEMPLATE_PATH)/Makefile.posix
endif
MK := mkdir
RM := rm -rf
#echo suspend
ifeq ("$(VERBOSE)","1")
NO_ECHO :=
else
NO_ECHO := @
endif
# Toolchain commands
CC := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc"
AS := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-as"
AR := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ar" -r
LD := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld"
NM := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-nm"
OBJDUMP := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objdump"
OBJCOPY := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objcopy"
SIZE := "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-size"
#function for removing duplicates in a list
remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1),$1))))
#source common to all targets
C_SOURCE_FILES_SDK = \
../../../../nrf51_iot_sdk/components/libraries/button/app_button.c \
../../../../nrf51_iot_sdk/components/libraries/util/app_error.c \
../../../../nrf51_iot_sdk/components/libraries/fifo/app_fifo.c \
../../../../nrf51_iot_sdk/components/libraries/scheduler/app_scheduler.c \
../../../../nrf51_iot_sdk/components/libraries/timer/app_timer.c \
../../../../nrf51_iot_sdk/components/libraries/timer/app_timer_appsh.c \
../../../../nrf51_iot_sdk/components/libraries/trace/app_trace.c \
../../../../nrf51_iot_sdk/components/libraries/mem_manager/mem_manager.c \
../../../../nrf51_iot_sdk/components/libraries/util/nrf_assert.c \
../../../../nrf51_iot_sdk/external/lwip/src/port/nrf_platform_port.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/uart/app_uart_fifo.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/hal/nrf_delay.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/common/nrf_drv_common.c \
../../../../nrf51_iot_sdk/components/drivers_nrf/gpiote/nrf_drv_gpiote.c \
../../../../nrf51_iot_sdk/components/ble/common/ble_advdata.c \
../../../../nrf51_iot_sdk/components/ble/common/ble_srv_common.c \
../../../../nrf51_iot_sdk/components/iot/context_manager/iot_context_manager.c \
../../../../nrf51_iot_sdk/components/toolchain/system_nrf51.c \
../../../../nrf51_iot_sdk/components/softdevice/common/softdevice_handler/softdevice_handler.c \
../../../../nrf51_iot_sdk/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c \
C_SOURCE_FILES_APP = \
../../../main.c \
../../../bleconfig.c \
../../../rtt/RTT/SEGGER_RTT.c \
../../../rtt/RTT/SEGGER_RTT_printf.c \
../../../rtt/Syscalls/RTT_Syscalls_GCC.c \
../../../../../../mongoose.c \
C_SOURCE_FILES = $(C_SOURCE_FILES_SDK) $(C_SOURCE_FILES_APP)
#assembly files common to all targets
ASM_SOURCE_FILES = ../../../../nrf51_iot_sdk/components/toolchain/gcc/gcc_startup_nrf51.s
#assembly files common to all targets
LIBS = ../../../../nrf51_iot_sdk/external/lwip/lib/liblwip.a
LIBS += ../../../../nrf51_iot_sdk/components/iot/ble_6lowpan/lib/ble_6lowpan.a
#includes common to all targets
INC_PATHS = -I../../../config
INC_PATHS += -I../../../../nrf51_iot_sdk/components/softdevice/s1xx_iot/headers
INC_PATHS += -I../../../../nrf51_iot_sdk/components/drivers_nrf/common
INC_PATHS += -I../../../../nrf51_iot_sdk/components/softdevice/common/softdevice_handler
INC_PATHS += -I../../../../nrf51_iot_sdk/external/lwip/src/include
INC_PATHS += -I../../../../nrf51_iot_sdk/components/iot/ble_6lowpan
INC_PATHS += -I../../../../nrf51_iot_sdk/components/drivers_nrf/hal
INC_PATHS += -I../../../../nrf51_iot_sdk/components/ble/common
INC_PATHS += -I../../../../nrf51_iot_sdk/external/lwip/src/port
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/fifo
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/trace
INC_PATHS += -I../../../../nrf51_iot_sdk/components/device
INC_PATHS += -I../../../../nrf51_iot_sdk/components/drivers_nrf/config
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/mem_manager
INC_PATHS += -I../../../../nrf51_iot_sdk/components/drivers_nrf/uart
INC_PATHS += -I../../../../nrf51_iot_sdk/components/iot/ble_ipsp
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/scheduler
INC_PATHS += -I../../../../nrf51_iot_sdk/external/lwip/src/include/netif
INC_PATHS += -I../../../../nrf51_iot_sdk/components/iot/include
INC_PATHS += -I../../..
INC_PATHS += -I../../../../../..
INC_PATHS += -I../../../rtt/RTT
INC_PATHS += -I../../../../nrf51_iot_sdk/components/iot/context_manager
INC_PATHS += -I../../../../nrf51_iot_sdk/components/toolchain/gcc
INC_PATHS += -I../../../../nrf51_iot_sdk/components/drivers_nrf/gpiote
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/timer
INC_PATHS += -I../../../../nrf51_iot_sdk/external/lwip/src/port/arch
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/button
INC_PATHS += -I../../../../nrf51_iot_sdk/components/libraries/util
INC_PATHS += -I../../../../nrf51_iot_sdk/examples/bsp
INC_PATHS += -I../../../../nrf51_iot_sdk/components/toolchain
OBJECT_DIRECTORY = _build
LISTING_DIRECTORY = $(OBJECT_DIRECTORY)
OUTPUT_BINARY_DIRECTORY = $(OBJECT_DIRECTORY)
# Sorting removes duplicates
BUILD_DIRECTORIES := $(sort $(OBJECT_DIRECTORY) $(OUTPUT_BINARY_DIRECTORY) $(LISTING_DIRECTORY) )
# Mongoose features
MG_FEATURES_TINY = \
-DMG_DISABLE_HTTP_DIGEST_AUTH \
-DMG_DISABLE_MD5 \
-DMG_DISABLE_HTTP_KEEP_ALIVE \
-DMG_ENABLE_HTTP_SSI=0 \
-DMG_ENABLE_HTTP_STREAMING_MULTIPART
#flags common to all targets
CFLAGS = -D__HEAP_SIZE=512
CFLAGS += -DSWI_DISABLE0
CFLAGS += -DBOARD_PCA10028
CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -DNRF51
CFLAGS += -DS110
CFLAGS += -DBLE_STACK_SUPPORT_REQD
CFLAGS += -DBSP_DEFINES_ONLY
CFLAGS += -mcpu=cortex-m0
CFLAGS += -mthumb -mabi=aapcs --std=gnu99
CFLAGS += -g3 -O3
CFLAGS += -mfloat-abi=soft
# keep every function in separate section. This will allow linker to dump unused functions
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
CFLAGS += -fno-builtin --short-enums
CFLAGS += -DCS_ENABLE_STDIO
# This macro is needed for stdout to be retargeted to either UART or RTT
CFLAGS += -DENABLE_DEBUG_LOG_SUPPORT
# Mongoose flags
CFLAGS += -DCS_PLATFORM=CS_P_NRF51 $(MG_FEATURES_TINY) -DMG_MODULE_LINES
# keep every function in separate section. This will allow linker to dump unused functions
LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
LDFLAGS += -mcpu=cortex-m0
# let linker to dump unused sections
LDFLAGS += -Wl,--gc-sections
# use newlib in nano version
LDFLAGS += --specs=nano.specs -lc -lnosys
# Assembler flags
ASMFLAGS += -x assembler-with-cpp
ASMFLAGS += -D__HEAP_SIZE=512
ASMFLAGS += -DSWI_DISABLE0
ASMFLAGS += -DBOARD_PCA10028
ASMFLAGS += -DSOFTDEVICE_PRESENT
ASMFLAGS += -DNRF51
ASMFLAGS += -DS110
ASMFLAGS += -DBLE_STACK_SUPPORT_REQD
ASMFLAGS += -DBSP_DEFINES_ONLY
#default target - first one defined
default: clean nrf51422_xxac_s1xx_iot
#building all targets
all: clean
$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e cleanobj
$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e nrf51422_xxac_s1xx_iot
#target for printing all targets
help:
@echo following targets are available:
@echo nrf51422_xxac_s1xx_iot
C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
C_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES:.c=.o) )
C_SOURCE_FILE_NAMES_SDK = $(notdir $(C_SOURCE_FILES_SDK))
C_SOURCE_FILE_NAMES_APP = $(notdir $(C_SOURCE_FILES_APP))
C_OBJECTS_SDK = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES_SDK:.c=.o) )
C_OBJECTS_APP = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES_APP:.c=.o) )
# Disable all warnings for SDK sources since we have no control of them
$(C_OBJECTS_SDK): CFLAGS += -w
# Enable all warnings for the application's files
$(C_OBJECTS_APP): CFLAGS += -Wall
ASM_SOURCE_FILE_NAMES = $(notdir $(ASM_SOURCE_FILES))
ASM_PATHS = $(call remduplicates, $(dir $(ASM_SOURCE_FILES) ))
ASM_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(ASM_SOURCE_FILE_NAMES:.s=.o) )
vpath %.c $(C_PATHS)
vpath %.s $(ASM_PATHS)
OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
nrf51422_xxac_s1xx_iot: OUTPUT_FILENAME := nrf51422_xxac_s1xx_iot
nrf51422_xxac_s1xx_iot: LINKER_SCRIPT=iot_lwip_tcp_server_gcc_nrf51.ld
nrf51422_xxac_s1xx_iot: $(BUILD_DIRECTORIES) $(OBJECTS)
@echo Linking target: $(OUTPUT_FILENAME).out
$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e finalize
## Create build directories
$(BUILD_DIRECTORIES):
echo $(MAKEFILE_NAME)
$(MK) $@
# Create objects from C SRC files
$(OBJECT_DIRECTORY)/%.o: %.c
@echo Compiling file: $(notdir $<)
$(NO_ECHO)$(CC) $(CFLAGS) $(INC_PATHS) -c -o $@ $<
# Assemble files
$(OBJECT_DIRECTORY)/%.o: %.s
@echo Compiling file: $(notdir $<)
$(NO_ECHO)$(CC) $(ASMFLAGS) $(INC_PATHS) -c -o $@ $<
# Link
$(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out: $(BUILD_DIRECTORIES) $(OBJECTS)
@echo Linking target: $(OUTPUT_FILENAME).out
$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
## Create binary .bin file from the .out file
$(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
@echo Preparing: $(OUTPUT_FILENAME).bin
$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
## Create binary .hex file from the .out file
$(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
@echo Preparing: $(OUTPUT_FILENAME).hex
$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
finalize: genbin genhex echosize
genbin:
@echo Preparing: $(OUTPUT_FILENAME).bin
$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
## Create binary .hex file from the .out file
genhex:
@echo Preparing: $(OUTPUT_FILENAME).hex
$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
echosize:
-@echo ""
$(NO_ECHO)$(SIZE) $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
-@echo ""
clean:
$(RM) $(BUILD_DIRECTORIES)
cleanobj:
$(RM) $(BUILD_DIRECTORIES)/*.o
flash: $(MAKECMDGOALS)
@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/$<.hex
nrfjprog --reset --program $(OUTPUT_BINARY_DIRECTORY)/$<.hex
## Flash softdevice
@@ -0,0 +1,12 @@
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0x28000
RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0x6000
}
INCLUDE "gcc_nrf51_common.ld"
+139
View File
@@ -0,0 +1,139 @@
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
/* clang-format off */
#ifndef NRF_DRV_CONFIG_H
#define NRF_DRV_CONFIG_H
/* CLOCK */
#define CLOCK_CONFIG_XTAL_FREQ NRF_CLOCK_XTALFREQ_16MHz
#define CLOCK_CONFIG_LF_SRC NRF_CLOCK_LF_SRC_Xtal
#define CLOCK_CONFIG_LF_RC_CAL_INTERVAL RC_2000MS_CALIBRATION_INTERVAL
#define CLOCK_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
/* GPIOTE */
#define GPIOTE_ENABLED 1
#if (GPIOTE_ENABLED == 1)
#define GPIOTE_CONFIG_USE_SWI_EGU false
#define GPIOTE_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_HIGH
#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 6
#endif
/* TIMER */
#define TIMER0_ENABLED 0
#if (TIMER0_ENABLED == 1)
#define TIMER0_CONFIG_FREQUENCY NRF_TIMER_FREQ_16MHz
#define TIMER0_CONFIG_MODE TIMER_MODE_MODE_Timer
#define TIMER0_CONFIG_BIT_WIDTH TIMER_BITMODE_BITMODE_32Bit
#define TIMER0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define TIMER0_INSTANCE_INDEX 0
#endif
#define TIMER1_ENABLED 0
#if (TIMER1_ENABLED == 1)
#define TIMER1_CONFIG_FREQUENCY NRF_TIMER_FREQ_16MHz
#define TIMER1_CONFIG_MODE TIMER_MODE_MODE_Timer
#define TIMER1_CONFIG_BIT_WIDTH TIMER_BITMODE_BITMODE_16Bit
#define TIMER1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define TIMER1_INSTANCE_INDEX (TIMER0_ENABLED)
#endif
#define TIMER2_ENABLED 0
#if (TIMER2_ENABLED == 1)
#define TIMER2_CONFIG_FREQUENCY NRF_TIMER_FREQ_16MHz
#define TIMER2_CONFIG_MODE TIMER_MODE_MODE_Timer
#define TIMER2_CONFIG_BIT_WIDTH TIMER_BITMODE_BITMODE_16Bit
#define TIMER2_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define TIMER2_INSTANCE_INDEX (TIMER1_ENABLED+TIMER0_ENABLED)
#endif
#define TIMER_COUNT (TIMER0_ENABLED + TIMER1_ENABLED + TIMER2_ENABLED)
/* RTC */
#define RTC0_ENABLED 0
#if (RTC0_ENABLED == 1)
#define RTC0_CONFIG_FREQUENCY 32678
#define RTC0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define RTC0_CONFIG_RELIABLE false
#define RTC0_INSTANCE_INDEX 0
#endif
#define RTC1_ENABLED 0
#if (RTC1_ENABLED == 1)
#define RTC1_CONFIG_FREQUENCY 32768
#define RTC1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define RTC1_CONFIG_RELIABLE false
#define RTC1_INSTANCE_INDEX (RTC0_ENABLED)
#endif
#define RTC_COUNT (RTC0_ENABLED+RTC1_ENABLED)
#define NRF_MAXIMUM_LATENCY_US 2000
/* RNG */
#define RNG_ENABLED 0
#if (RNG_ENABLED == 1)
#define RNG_CONFIG_ERROR_CORRECTION true
#define RNG_CONFIG_POOL_SIZE 8
#define RNG_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#endif
/* QDEC */
#define QDEC_ENABLED 0
#if (QDEC_ENABLED == 1)
#define QDEC_CONFIG_REPORTPER NRF_QDEC_REPORTPER_10
#define QDEC_CONFIG_SAMPLEPER NRF_QDEC_SAMPLEPER_16384us
#define QDEC_CONFIG_PIO_A 1
#define QDEC_CONFIG_PIO_B 2
#define QDEC_CONFIG_PIO_LED 3
#define QDEC_CONFIG_LEDPRE 511
#define QDEC_CONFIG_LEDPOL NRF_QDEC_LEPOL_ACTIVE_HIGH
#define QDEC_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define QDEC_CONFIG_DBFEN false
#define QDEC_CONFIG_SAMPLE_INTEN false
#endif
/* LPCOMP */
#define LPCOMP_ENABLED 0
#if (LPCOMP_ENABLED == 1)
#define LPCOMP_CONFIG_REFERENCE NRF_LPCOMP_REF_SUPPLY_FOUR_EIGHT
#define LPCOMP_CONFIG_DETECTION NRF_LPCOMP_DETECT_DOWN
#define LPCOMP_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#define LPCOMP_CONFIG_INPUT NRF_LPCOMP_INPUT_0
#endif
/* WDT */
#define WDT_ENABLED 0
#if (WDT_ENABLED == 1)
#define WDT_CONFIG_BEHAVIOUR NRF_WDT_BEHAVIOUR_RUN_SLEEP
#define WDT_CONFIG_RELOAD_VALUE 2000
#define WDT_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_HIGH
#endif
#endif // NRF_DRV_CONFIG_H
+90
View File
@@ -0,0 +1,90 @@
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
*/
#include "bleconfig.h"
#include "myboard.h"
#include "mongoose.h"
/*
* This is a callback invoked by Mongoose to signal that a poll is needed soon.
* Since we're in a tight polling loop anyway (see below), we don't need to do
* anything.
*/
void mg_lwip_mgr_schedule_poll(struct mg_mgr *mgr) {
}
// Define an event handler function
void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
if (ev == MG_EV_POLL) return;
/* printf("ev %d\r\n", ev); */
switch (ev) {
case MG_EV_ACCEPT: {
char addr[32];
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
printf("%p: Connection from %s\r\n", nc, addr);
break;
}
case MG_EV_HTTP_REQUEST: {
struct http_message *hm = (struct http_message *) ev_data;
char addr[32];
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr),
MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
printf("%p: %.*s %.*s\r\n", nc, (int) hm->method.len, hm->method.p,
(int) hm->uri.len, hm->uri.p);
mg_send_response_line(nc, 200,
"Content-Type: text/html\r\n"
"Connection: close");
mg_printf(nc,
"\r\n<h1>Hello, %s!</h1>\r\n"
"You asked for %.*s\r\n",
addr, (int) hm->uri.len, hm->uri.p);
nc->flags |= MG_F_SEND_AND_CLOSE;
LEDS_INVERT(LED_THREE);
break;
}
case MG_EV_CLOSE: {
printf("%p: Connection closed\r\n", nc);
break;
}
}
}
/**
* @brief Function for application main entry.
*/
int main(void) {
cs_log_set_file(stdout);
bleconfig_init();
{
struct mg_mgr mgr;
mg_mgr_init(&mgr, NULL); // Initialize event manager object
// Note that many connections can be added to a single event manager
// Connections can be created at any point, e.g. in event handler function
const char *err;
struct mg_bind_opts opts;
struct mg_connection *nc = NULL;
memset(&opts, 0x00, sizeof(opts));
opts.error_string = &err;
nc = mg_bind_opt(
&mgr, "80", ev_handler,
opts); // Create listening connection and add it to the event manager
if (nc == NULL) {
printf("Failed to create listener: %s\n", err);
return 1;
}
mg_set_protocol_http_websocket(nc);
for (;;) { // Start infinite event loop
bleconfig_poll();
mg_mgr_poll(&mgr, 0);
}
}
}
+21
View File
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
*/
/* clang-format off */
#include "boards.h"
#define LED_ONE BSP_LED_0_MASK /**< Is on when device is advertising. */
#define LED_TWO BSP_LED_1_MASK /**< Is on when device is connected. */
#define LED_THREE BSP_LED_2_MASK
#define LED_FOUR BSP_LED_3_MASK
#define TCP_CONNECTED_LED BSP_LED_2_MASK /**< Is on when a TCP connection is established. */
#define DISPLAY_LED_0 BSP_LED_0_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_1 BSP_LED_1_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_2 BSP_LED_2_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define DISPLAY_LED_3 BSP_LED_3_MASK /**< LED used for displaying mod 4 of data payload received on UDP port. */
#define ALL_APP_LED (BSP_LED_0_MASK | BSP_LED_1_MASK | \
BSP_LED_2_MASK | BSP_LED_3_MASK) /**< Define used for simultaneous operation of all application LEDs. */
+18
View File
@@ -0,0 +1,18 @@
README.txt for the SEGGER RTT Implementation Pack.
Date: 17 Dec 2014
Included files:
===============
Root Directory
- Examples
- RTT_MenuApp.c - Sample application to demonstrate RTT bi-directional functionality. No OS.
- RTT_embOS_SpeedTestApp.c - Sample application for measuring RTT performance. embOS needed.
- RTT
- SEGGER_RTT.c - The RTT implementation.
- SEGGER_RTT.h - Header for RTT implementation.
- SEGGER_RTT_Conf.h - Pre-processor configuration for the RTT implementation.
- SEGGER_RTT_Printf.c - Simple implementation of printf to write formatted strings via RTT.
- Syscalls
- RTT_Syscalls_GCC.c - Low-level syscalls to retarget printf() to RTT with GCC / Newlib.
- RTT_Syscalls_IAR.c - Low-level syscalls to retarget printf() to RTT with IAR compiler.
- RTT_Syscalls_KEIL.c - Low-level syscalls to retarget printf() to RTT with KEIL/uVision compiler.
+592
View File
@@ -0,0 +1,592 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014-2014 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT.c
Date : 17 Dec 2014
Purpose : Implementation of SEGGER real-time terminal (RTT) which allows
real-time terminal communication on targets which support
debugger memory accesses while the CPU is running.
Type "int" is assumed to be 32-bits in size
H->T Host to target communication
T->H Target to host communication
RTT channel 0 is always present and reserved for Terminal usage.
Name is fixed to "Terminal"
---------------------------END-OF-HEADER------------------------------
*/
#include "SEGGER_RTT_Conf.h"
#include "SEGGER_RTT.h"
#include <string.h> // for memcpy
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
#ifndef BUFFER_SIZE_UP
#define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host
#endif
#ifndef BUFFER_SIZE_DOWN
#define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input)
#endif
#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (1) // Number of up-buffers (T->H) available on this target
#endif
#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (1) // Number of down-buffers (H->T) available on this target
#endif
#ifndef SEGGER_RTT_LOCK
#define SEGGER_RTT_LOCK()
#endif
#ifndef SEGGER_RTT_UNLOCK
#define SEGGER_RTT_UNLOCK()
#endif
#ifndef SEGGER_RTT_IN_RAM
#define SEGGER_RTT_IN_RAM (0)
#endif
/*********************************************************************
*
* Defines, fixed
*
**********************************************************************
*/
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MEMCPY(a, b, c) memcpy((a),(b),(c))
//
// For some environments, NULL may not be defined until certain headers are included
//
#ifndef NULL
#define NULL 0
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// Description for a circular buffer (also called "ring buffer")
// which is used as up- (T->H) or down-buffer (H->T)
//
typedef struct {
const char* sName; // Optional name. Standard names so far are: "Terminal", "VCom"
char* pBuffer; // Pointer to start of buffer
int SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
volatile int WrOff; // Position of next item to be written by either host (down-buffer) or target (up-buffer). Must be volatile since it may be modified by host (down-buffer)
volatile int RdOff; // Position of next item to be read by target (down-buffer) or host (up-buffer). Must be volatile since it may be modified by host (up-buffer)
int Flags; // Contains configuration flags
} RING_BUFFER;
//
// RTT control block which describes the number of buffers available
// as well as the configuration for each buffer
//
//
typedef struct {
char acID[16]; // Initialized to "SEGGER RTT"
int MaxNumUpBuffers; // Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2)
int MaxNumDownBuffers; // Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2)
RING_BUFFER aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS]; // Up buffers, transferring information up from target via debug probe to host
RING_BUFFER aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS]; // Down buffers, transferring information down from host via debug probe to target
} SEGGER_RTT_CB;
/*********************************************************************
*
* Static data
*
**********************************************************************
*/
//
// Allocate buffers for channel 0
//
static char _acUpBuffer [BUFFER_SIZE_UP];
static char _acDownBuffer[BUFFER_SIZE_DOWN];
//
// Initialize SEGGER Real-time-Terminal control block (CB)
//
static SEGGER_RTT_CB _SEGGER_RTT = {
#if SEGGER_RTT_IN_RAM
"SEGGER RTTI",
#else
"SEGGER RTT",
#endif
SEGGER_RTT_MAX_NUM_UP_BUFFERS,
SEGGER_RTT_MAX_NUM_DOWN_BUFFERS,
{{ "Terminal", &_acUpBuffer[0], sizeof(_acUpBuffer), 0, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP }},
{{ "Terminal", &_acDownBuffer[0], sizeof(_acDownBuffer), 0, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP }},
};
static char _ActiveTerminal;
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
/*********************************************************************
*
* _strlen
*
* Function description
* ANSI compatible function to determine the length of a string
*
* Return value
* Length of string in bytes.
*
* Parameters
* s Pointer to \0 terminated string.
*
* Notes
* (1) s needs to point to an \0 terminated string. Otherwise proper functionality of this function is not guaranteed.
*/
static int _strlen(const char* s) {
int Len;
Len = 0;
if (s == NULL) {
return 0;
}
do {
if (*s == 0) {
break;
}
Len++;
s++;
} while (1);
return Len;
}
/*********************************************************************
*
* _Init
*
* Function description
* In case SEGGER_RTT_IN_RAM is defined,
* _Init() modifies the ID of the RTT CB to allow identifying the
* RTT Control Block Structure in the data segment.
*/
static void _Init(void) {
#if SEGGER_RTT_IN_RAM
if (_SEGGER_RTT.acID[10] == 'I') {
_SEGGER_RTT.acID[10] = '\0';
}
#endif
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* SEGGER_RTT_Read
*
* Function description
* Reads characters from SEGGER real-time-terminal control block
* which have been previously stored by the host.
*
* Parameters
* BufferIndex Index of Down-buffer to be used. (e.g. 0 for "Terminal")
* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-down-buffer to.
* BufferSize Size of the target application buffer
*
* Return values
* Number of bytes that have been read
*/
int SEGGER_RTT_Read(unsigned BufferIndex, char* pBuffer, unsigned BufferSize) {
int NumBytesRem;
unsigned NumBytesRead;
int RdOff;
int WrOff;
SEGGER_RTT_LOCK();
_Init();
RdOff = _SEGGER_RTT.aDown[BufferIndex].RdOff;
WrOff = _SEGGER_RTT.aDown[BufferIndex].WrOff;
NumBytesRead = 0;
//
// Read from current read position to wrap-around of buffer, first
//
if (RdOff > WrOff) {
NumBytesRem = _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer - RdOff;
NumBytesRem = MIN(NumBytesRem, (int)BufferSize);
MEMCPY(pBuffer, _SEGGER_RTT.aDown[BufferIndex].pBuffer + RdOff, NumBytesRem);
NumBytesRead += NumBytesRem;
pBuffer += NumBytesRem;
BufferSize -= NumBytesRem;
RdOff += NumBytesRem;
//
// Handle wrap-around of buffer
//
if (RdOff == _SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer) {
RdOff = 0;
}
}
//
// Read remaining items of buffer
//
NumBytesRem = WrOff - RdOff;
NumBytesRem = MIN(NumBytesRem, (int)BufferSize);
if (NumBytesRem > 0) {
MEMCPY(pBuffer, _SEGGER_RTT.aDown[BufferIndex].pBuffer + RdOff, NumBytesRem);
NumBytesRead += NumBytesRem;
pBuffer += NumBytesRem;
BufferSize -= NumBytesRem;
RdOff += NumBytesRem;
}
if (NumBytesRead) {
_SEGGER_RTT.aDown[BufferIndex].RdOff = RdOff;
}
SEGGER_RTT_UNLOCK();
return NumBytesRead;
}
/*********************************************************************
*
* SEGGER_RTT_Write
*
* Function description
* Stores a specified number of characters in SEGGER RTT
* control block which is then read by the host.
*
* Parameters
* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
*
* Return values
* Number of bytes which have been stored in the "Up"-buffer.
*
* Notes
* (1) If there is not enough space in the "Up"-buffer, remaining characters of pBuffer are dropped.
*/
int SEGGER_RTT_Write(unsigned BufferIndex, const char* pBuffer, unsigned NumBytes) {
int NumBytesToWrite;
unsigned NumBytesWritten;
int RdOff;
//
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
// Otherwise we would probably end up with a mixed string in the buffer.
//
SEGGER_RTT_LOCK();
_Init();
//
// In case we are not in blocking mode,
// we need to calculate, how many bytes we can put into the buffer at all.
//
if ((_SEGGER_RTT.aUp[BufferIndex].Flags & SEGGER_RTT_MODE_MASK) != SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL) {
RdOff = _SEGGER_RTT.aUp[BufferIndex].RdOff;
NumBytesToWrite = RdOff - _SEGGER_RTT.aUp[BufferIndex].WrOff - 1;
if (NumBytesToWrite < 0) {
NumBytesToWrite += _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer;
}
//
// If the complete data does not fit in the buffer, check if we have to skip it completely or trim the data
//
if ((int)NumBytes > NumBytesToWrite) {
if ((_SEGGER_RTT.aUp[BufferIndex].Flags & SEGGER_RTT_MODE_MASK) == SEGGER_RTT_MODE_NO_BLOCK_SKIP) {
SEGGER_RTT_UNLOCK();
return 0;
} else {
NumBytes = NumBytesToWrite;
}
}
}
//
// Early out if nothing is to do
//
if (NumBytes == 0) {
SEGGER_RTT_UNLOCK();
return 0;
}
//
// Write data to buffer and handle wrap-around if necessary
//
NumBytesWritten = 0;
do {
RdOff = _SEGGER_RTT.aUp[BufferIndex].RdOff; // May be changed by host (debug probe) in the meantime
NumBytesToWrite = RdOff - _SEGGER_RTT.aUp[BufferIndex].WrOff - 1;
if (NumBytesToWrite < 0) {
NumBytesToWrite += _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer;
}
NumBytesToWrite = MIN(NumBytesToWrite, (_SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer - _SEGGER_RTT.aUp[BufferIndex].WrOff)); // Number of bytes that can be written until buffer wrap-around
NumBytesToWrite = MIN(NumBytesToWrite, (int)NumBytes);
MEMCPY(_SEGGER_RTT.aUp[BufferIndex].pBuffer + _SEGGER_RTT.aUp[BufferIndex].WrOff, pBuffer, NumBytesToWrite);
NumBytesWritten += NumBytesToWrite;
pBuffer += NumBytesToWrite;
NumBytes -= NumBytesToWrite;
_SEGGER_RTT.aUp[BufferIndex].WrOff += NumBytesToWrite;
if (_SEGGER_RTT.aUp[BufferIndex].WrOff == _SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer) {
_SEGGER_RTT.aUp[BufferIndex].WrOff = 0;
}
} while (NumBytes);
SEGGER_RTT_UNLOCK();
return NumBytesWritten;
}
/*********************************************************************
*
* SEGGER_RTT_WriteString
*
* Function description
* Stores string in SEGGER RTT control block.
* This data is read by the host.
*
* Parameters
* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
* s Pointer to string.
*
* Return values
* Number of bytes which have been stored in the "Up"-buffer.
*
* Notes
* (1) If there is not enough space in the "Up"-buffer, depending on configuration,
* remaining characters may be dropped or RTT module waits until there is more space in the buffer.
* (2) String passed to this function has to be \0 terminated
* (3) \0 termination character is *not* stored in RTT buffer
*/
int SEGGER_RTT_WriteString(unsigned BufferIndex, const char* s) {
int Len;
Len = _strlen(s);
return SEGGER_RTT_Write(BufferIndex, s, Len);
}
/*********************************************************************
*
* SEGGER_RTT_GetKey
*
* Function description
* Reads one character from the SEGGER RTT buffer.
* Host has previously stored data there.
*
* Return values
* < 0 No character available (buffer empty).
* >= 0 Character which has been read. (Possible values: 0 - 255)
*
* Notes
* (1) This function is only specified for accesses to RTT buffer 0.
*/
int SEGGER_RTT_GetKey(void) {
char c;
int r;
r = SEGGER_RTT_Read(0, &c, 1);
if (r == 1) {
return (int)(unsigned char)c;
}
return -1;
}
/*********************************************************************
*
* SEGGER_RTT_WaitKey
*
* Function description
* Waits until at least one character is avaible in the SEGGER RTT buffer.
* Once a character is available, it is read and this function returns.
*
* Return values
* >=0 Character which has been read.
*
* Notes
* (1) This function is only specified for accesses to RTT buffer 0
* (2) This function is blocking if no character is present in RTT buffer
*/
int SEGGER_RTT_WaitKey(void) {
int r;
do {
r = SEGGER_RTT_GetKey();
} while (r < 0);
return r;
}
/*********************************************************************
*
* SEGGER_RTT_HasKey
*
* Function description
* Checks if at least one character for reading is available in the SEGGER RTT buffer.
*
* Return values
* 0 No characters are available to read.
* 1 At least one character is available.
*
* Notes
* (1) This function is only specified for accesses to RTT buffer 0
*/
int SEGGER_RTT_HasKey(void) {
int RdOff;
_Init();
RdOff = _SEGGER_RTT.aDown[0].RdOff;
if (RdOff != _SEGGER_RTT.aDown[0].WrOff) {
return 1;
}
return 0;
}
/*********************************************************************
*
* SEGGER_RTT_ConfigUpBuffer
*
* Function description
* Run-time configuration of a specific up-buffer (T->H).
* Buffer to be configured is specified by index.
* This includes: Buffer address, size, name, flags, ...
*
* Return value
* >= 0 O.K.
* < 0 Error
*/
int SEGGER_RTT_ConfigUpBuffer(unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags) {
_Init();
if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumUpBuffers) {
SEGGER_RTT_LOCK();
if (BufferIndex > 0) {
_SEGGER_RTT.aUp[BufferIndex].sName = sName;
_SEGGER_RTT.aUp[BufferIndex].pBuffer = pBuffer;
_SEGGER_RTT.aUp[BufferIndex].SizeOfBuffer = BufferSize;
_SEGGER_RTT.aUp[BufferIndex].RdOff = 0;
_SEGGER_RTT.aUp[BufferIndex].WrOff = 0;
}
_SEGGER_RTT.aUp[BufferIndex].Flags = Flags;
SEGGER_RTT_UNLOCK();
return 0;
}
return -1;
}
/*********************************************************************
*
* SEGGER_RTT_ConfigDownBuffer
*
* Function description
* Run-time configuration of a specific down-buffer (H->T).
* Buffer to be configured is specified by index.
* This includes: Buffer address, size, name, flags, ...
*
* Return value
* >= 0 O.K.
* < 0 Error
*/
int SEGGER_RTT_ConfigDownBuffer(unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags) {
_Init();
if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumDownBuffers) {
SEGGER_RTT_LOCK();
if (BufferIndex > 0) {
_SEGGER_RTT.aDown[BufferIndex].sName = sName;
_SEGGER_RTT.aDown[BufferIndex].pBuffer = pBuffer;
_SEGGER_RTT.aDown[BufferIndex].SizeOfBuffer = BufferSize;
_SEGGER_RTT.aDown[BufferIndex].RdOff = 0;
_SEGGER_RTT.aDown[BufferIndex].WrOff = 0;
}
_SEGGER_RTT.aDown[BufferIndex].Flags = Flags;
SEGGER_RTT_UNLOCK();
return 0;
}
return -1;
}
/*********************************************************************
*
* SEGGER_RTT_Init
*
* Function description
* Initializes the RTT Control Block.
* Should be used in RAM targets, at start of the application.
*
*/
void SEGGER_RTT_Init (void) {
_Init();
}
/*********************************************************************
*
* SEGGER_RTT_SetTerminal
*
* Function description
* Sets the terminal to be used for output on channel 0.
*
*/
void SEGGER_RTT_SetTerminal (char TerminalId) {
char ac[2];
ac[0] = 0xFF;
if (TerminalId < 10) {
ac[1] = '0' + TerminalId;
} else if (TerminalId < 16) {
ac[1] = 'A' + (TerminalId - 0x0A);
} else {
return; // RTT only supports up to 16 virtual terminals.
}
_ActiveTerminal = TerminalId;
SEGGER_RTT_Write(0, ac, 2);
}
/*********************************************************************
*
* SEGGER_RTT_TerminalOut
*
* Function description
* Writes a string to the given terminal
* without changing the terminal for channel 0.
*
*/
int SEGGER_RTT_TerminalOut (char TerminalId, const char* s) {
char ac[2];
int r;
ac[0] = 0xFF;
if (TerminalId < 10) {
ac[1] = '0' + TerminalId;
} else if (TerminalId < 16) {
ac[1] = 'A' + (TerminalId - 0x0A);
} else {
return -1; // RTT only supports up to 16 virtual terminals.
}
SEGGER_RTT_Write(0, ac, 2);
r = SEGGER_RTT_WriteString(0, s);
if (TerminalId < 10) {
ac[1] = '0' + _ActiveTerminal;
} else if (TerminalId < 16) {
ac[1] = 'A' + (_ActiveTerminal - 0x0A);
}
SEGGER_RTT_Write(0, ac, 2);
return r;
}
/*************************** End of file ****************************/
+111
View File
@@ -0,0 +1,111 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER SYSTEME GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT.h
Date : 17 Dec 2014
Purpose : Implementation of SEGGER real-time terminal which allows
real-time terminal communication on targets which support
debugger memory accesses while the CPU is running.
---------------------------END-OF-HEADER------------------------------
*/
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define SEGGER_RTT_MODE_MASK (3 << 0)
#define SEGGER_RTT_MODE_NO_BLOCK_SKIP (0)
#define SEGGER_RTT_MODE_NO_BLOCK_TRIM (1 << 0)
#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (1 << 1)
#define RTT_CTRL_RESET ""
#define RTT_CTRL_CLEAR ""
#define RTT_CTRL_TEXT_BLACK ""
#define RTT_CTRL_TEXT_RED ""
#define RTT_CTRL_TEXT_GREEN ""
#define RTT_CTRL_TEXT_YELLOW ""
#define RTT_CTRL_TEXT_BLUE ""
#define RTT_CTRL_TEXT_MAGENTA ""
#define RTT_CTRL_TEXT_CYAN ""
#define RTT_CTRL_TEXT_WHITE ""
#define RTT_CTRL_TEXT_BRIGHT_BLACK ""
#define RTT_CTRL_TEXT_BRIGHT_RED ""
#define RTT_CTRL_TEXT_BRIGHT_GREEN ""
#define RTT_CTRL_TEXT_BRIGHT_YELLOW ""
#define RTT_CTRL_TEXT_BRIGHT_BLUE ""
#define RTT_CTRL_TEXT_BRIGHT_MAGENTA ""
#define RTT_CTRL_TEXT_BRIGHT_CYAN ""
#define RTT_CTRL_TEXT_BRIGHT_WHITE ""
#define RTT_CTRL_BG_BLACK ""
#define RTT_CTRL_BG_RED ""
#define RTT_CTRL_BG_GREEN ""
#define RTT_CTRL_BG_YELLOW ""
#define RTT_CTRL_BG_BLUE ""
#define RTT_CTRL_BG_MAGENTA ""
#define RTT_CTRL_BG_CYAN ""
#define RTT_CTRL_BG_WHITE ""
#define RTT_CTRL_BG_BRIGHT_BLACK ""
#define RTT_CTRL_BG_BRIGHT_RED ""
#define RTT_CTRL_BG_BRIGHT_GREEN ""
#define RTT_CTRL_BG_BRIGHT_YELLOW ""
#define RTT_CTRL_BG_BRIGHT_BLUE ""
#define RTT_CTRL_BG_BRIGHT_MAGENTA ""
#define RTT_CTRL_BG_BRIGHT_CYAN ""
#define RTT_CTRL_BG_BRIGHT_WHITE ""
/*********************************************************************
*
* RTT API functions
*
**********************************************************************
*/
int SEGGER_RTT_Read (unsigned BufferIndex, char* pBuffer, unsigned BufferSize);
int SEGGER_RTT_Write (unsigned BufferIndex, const char* pBuffer, unsigned NumBytes);
int SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s);
int SEGGER_RTT_GetKey (void);
int SEGGER_RTT_WaitKey (void);
int SEGGER_RTT_HasKey (void);
int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, char* pBuffer, int BufferSize, int Flags);
void SEGGER_RTT_Init (void);
/*********************************************************************
*
* RTT "Terminal" API functions
*
**********************************************************************
*/
void SEGGER_RTT_SetTerminal (char TerminalId);
int SEGGER_RTT_TerminalOut (char TerminalId, const char* s);
/*********************************************************************
*
* RTT printf functions (require SEGGER_RTT_printf.c)
*
**********************************************************************
*/
int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
/*************************** End of file ****************************/
@@ -0,0 +1,58 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER SYSTEME GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996-2014 SEGGER Microcontroller Systeme GmbH *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT_Conf.h
Date : 17 Dec 2014
Purpose : Implementation of SEGGER real-time terminal which allows
real-time terminal communication on targets which support
debugger memory accesses while the CPU is running.
---------------------------END-OF-HEADER------------------------------
*/
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (2) // Max. number of up-buffers (T->H) available on this target (Default: 2)
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (2) // Max. number of down-buffers (H->T) available on this target (Default: 2)
#define BUFFER_SIZE_UP (2048) // Size of the buffer for terminal output of target, up to host (Default: 1k)
#define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
//
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
// Otherwise we would probably end up with a mixed string in the buffer.
// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here.
//
#define SEGGER_RTT_LOCK()
#define SEGGER_RTT_UNLOCK()
//
// Define SEGGER_RTT_IN_RAM as 1
// when using RTT in RAM targets (init and data section both in RAM).
// This prevents the host to falsly identify the RTT Callback Structure
// in the init segment as the used Callback Structure.
//
// When defined as 1,
// the first call to an RTT function will modify the ID of the RTT Callback Structure.
// To speed up identifying on the host,
// especially when RTT functions are not called at the beginning of execution,
// SEGGER_RTT_Init() should be called at the start of the application.
//
#define SEGGER_RTT_IN_RAM (0)
/*************************** End of file ****************************/
@@ -0,0 +1,444 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014-2014 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER_RTT_printf.c
Date : 17 Dec 2014
Purpose : Replacement for printf to write formatted data via RTT
---------------------------END-OF-HEADER------------------------------
*/
#include "SEGGER_RTT.h"
#include "SEGGER_RTT_Conf.h"
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE
#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64)
#endif
#include <stdlib.h>
#include <stdarg.h>
#define FORMAT_FLAG_LEFT_JUSTIFY (1 << 0)
#define FORMAT_FLAG_PAD_ZERO (1 << 1)
#define FORMAT_FLAG_PRINT_SIGN (1 << 2)
#define FORMAT_FLAG_ALTERNATE (1 << 3)
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
char* pBuffer;
int BufferSize;
int Cnt;
int ReturnValue;
unsigned RTTBufferIndex;
} SEGGER_RTT_PRINTF_DESC;
/*********************************************************************
*
* Function prototypes
*
**********************************************************************
*/
int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList);
/*********************************************************************
*
* Static code
*
**********************************************************************
*/
/*********************************************************************
*
* _StoreChar
*/
static void _StoreChar(SEGGER_RTT_PRINTF_DESC * p, char c) {
int Cnt;
Cnt = p->Cnt;
if ((Cnt + 1) <= p->BufferSize) {
*(p->pBuffer + Cnt) = c;
p->Cnt = Cnt + 1;
p->ReturnValue++;
}
//
// Write part of string, when the buffer is full
//
if (p->Cnt == p->BufferSize) {
if (SEGGER_RTT_Write(p->RTTBufferIndex, p->pBuffer, p->Cnt) != p->Cnt) {
p->ReturnValue = -1;
} else {
p->Cnt = 0;
}
}
}
/*********************************************************************
*
* _PrintUnsigned
*/
static void _PrintUnsigned(SEGGER_RTT_PRINTF_DESC * pBufferDesc, unsigned v, unsigned Base, int NumDigits, unsigned FieldWidth, unsigned FormatFlags) {
static const char _aV2C[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
unsigned Div;
unsigned Digit = 1;
unsigned Number;
unsigned Width;
char c;
Number = v;
//
// Get actual field width
//
Width = 1;
while (Number >= Base) {
Number = (Number / Base);
Width++;
}
if ((unsigned)NumDigits > Width) {
Width = NumDigits;
}
//
// Print leading chars if necessary
//
if ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0) {
if (FieldWidth != 0) {
if (((FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && (NumDigits == 0)) {
c = '0';
} else {
c = ' ';
}
while ((FieldWidth != 0) && (Width < FieldWidth--)) {
_StoreChar(pBufferDesc, c);
if (pBufferDesc->ReturnValue < 0) {
return;
}
}
}
}
//
// Count how many digits are required by precision
//
while (((v / Digit) >= Base) | (NumDigits-- > 1)) {
Digit *= Base;
}
//
// Output digits
//
do {
Div = v / Digit;
v -= Div * Digit;
_StoreChar(pBufferDesc, _aV2C[Div]);
if (pBufferDesc->ReturnValue < 0) {
break;
}
Digit /= Base;
} while (Digit);
//
// Print trailing spaces if necessary
//
if ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == FORMAT_FLAG_LEFT_JUSTIFY) {
if (FieldWidth != 0) {
while ((FieldWidth != 0) && (Width < FieldWidth--)) {
_StoreChar(pBufferDesc, ' ');
if (pBufferDesc->ReturnValue < 0) {
return;
}
}
}
}
}
/*********************************************************************
*
* _PrintInt
*/
static void _PrintInt(SEGGER_RTT_PRINTF_DESC * pBufferDesc, int v, unsigned Base, unsigned NumDigits, unsigned FieldWidth, unsigned FormatFlags) {
unsigned Width;
unsigned Number;
Number = (v < 0) ? -v : v;
//
// Get actual field width
//
Width = 1;
while (Number >= Base) {
Number = (Number / Base);
Width++;
}
if (NumDigits > Width) {
Width = NumDigits;
}
if ((FieldWidth > 0) && ((v < 0) || ((FormatFlags & FORMAT_FLAG_PRINT_SIGN) == FORMAT_FLAG_PRINT_SIGN))) {
FieldWidth--;
}
//
// Print leading spaces if necessary
//
if ((((FormatFlags & FORMAT_FLAG_PAD_ZERO) == 0) || (NumDigits != 0)) && ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0)) {
if (FieldWidth != 0) {
while ((FieldWidth != 0) && (Width < FieldWidth--)) {
_StoreChar(pBufferDesc, ' ');
if (pBufferDesc->ReturnValue < 0) {
return;
}
}
}
}
//
// Print sign if necessary
//
if (v < 0) {
v = -v;
_StoreChar(pBufferDesc, '-');
if (pBufferDesc->ReturnValue < 0) {
return;
}
} else if ((FormatFlags & FORMAT_FLAG_PRINT_SIGN) == FORMAT_FLAG_PRINT_SIGN) {
_StoreChar(pBufferDesc, '+');
if (pBufferDesc->ReturnValue < 0) {
return;
}
}
//
// Print leading zeros if necessary
//
if (((FormatFlags & FORMAT_FLAG_PAD_ZERO) == FORMAT_FLAG_PAD_ZERO) && ((FormatFlags & FORMAT_FLAG_LEFT_JUSTIFY) == 0) && (NumDigits == 0)) {
if (FieldWidth != 0) {
while ((FieldWidth != 0) && (Width < FieldWidth--)) {
_StoreChar(pBufferDesc, '0');
if (pBufferDesc->ReturnValue < 0) {
return;
}
}
}
}
//
// Print number without sign
//
_PrintUnsigned(pBufferDesc, v, Base, NumDigits, FieldWidth, FormatFlags);
}
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* SEGGER_RTT_vprintf
*
* Function description
* Stores a formatted string in SEGGER RTT control block.
* This data is read by the host.
*
* Parameters
* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
* sFormat Pointer to format string
* pParamList Pointer to the list of arguments for the format string
*
* Return values
* >= 0: Number of bytes which have been stored in the "Up"-buffer.
* < 0: Error
*/
int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList) {
char c;
SEGGER_RTT_PRINTF_DESC BufferDesc;
int v;
unsigned NumDigits;
unsigned FormatFlags;
unsigned FieldWidth;
char acBuffer[SEGGER_RTT_PRINTF_BUFFER_SIZE];
BufferDesc.pBuffer = acBuffer;
BufferDesc.BufferSize = SEGGER_RTT_PRINTF_BUFFER_SIZE;
BufferDesc.Cnt = 0;
BufferDesc.RTTBufferIndex = BufferIndex;
BufferDesc.ReturnValue = 0;
do {
c = *sFormat++;
if (c == 0) {
break;
}
if (c == '%') {
//
// Filter out flags
//
FormatFlags = 0;
do {
c = *sFormat;
switch (c) {
case '-': FormatFlags |= FORMAT_FLAG_LEFT_JUSTIFY; sFormat++; break;
case '0': FormatFlags |= FORMAT_FLAG_PAD_ZERO; sFormat++; break;
case '+': FormatFlags |= FORMAT_FLAG_PRINT_SIGN; sFormat++; break;
case '#': FormatFlags |= FORMAT_FLAG_ALTERNATE; sFormat++; break;
default: goto FilterFieldWidth; break;
}
} while (1);
//
// filter out field with
//
FilterFieldWidth:
FieldWidth = 0;
do {
c = *sFormat;
if (c < '0' || c > '9') {
break;
}
sFormat++;
FieldWidth = FieldWidth * 10 + (c - '0');
} while (1);
//
// Filter out precision (number of digits to display)
//
NumDigits = 0;
c = *sFormat;
if (c == '.') {
sFormat++;
do {
c = *sFormat;
if (c < '0' || c > '9') {
break;
}
sFormat++;
NumDigits = NumDigits * 10 + (c - '0');
} while (1);
}
//
// Filter out length modifier
//
c = *sFormat;
do {
if (c == 'l' || c == 'h') {
c = *sFormat++;
continue;
}
break;
} while (1);
//
// Handle specifiers
//
switch (c) {
case 'c': {
char c0;
v = va_arg(*pParamList, int);
c0 = (char)v;
_StoreChar(&BufferDesc, c0);
break;
}
case 'd':
v = va_arg(*pParamList, int);
_PrintInt(&BufferDesc, v, 10, NumDigits, FieldWidth, FormatFlags);
break;
case 'u':
v = va_arg(*pParamList, int);
_PrintUnsigned(&BufferDesc, v, 10, NumDigits, FieldWidth, FormatFlags);
break;
case 'x':
case 'X':
v = va_arg(*pParamList, int);
_PrintUnsigned(&BufferDesc, v, 16, NumDigits, FieldWidth, FormatFlags);
break;
case 's':
{
const char * s = va_arg(*pParamList, const char *);
do {
c = *s++;
if (c == 0) {
break;
}
_StoreChar(&BufferDesc, c);
} while (BufferDesc.ReturnValue >= 0);
}
break;
case 'p':
v = va_arg(*pParamList, int);
_PrintUnsigned(&BufferDesc, v, 16, 8, 8, 0);
break;
case '%':
_StoreChar(&BufferDesc, '%');
break;
}
sFormat++;
} else {
_StoreChar(&BufferDesc, c);
}
} while (BufferDesc.ReturnValue >= 0);
if (BufferDesc.ReturnValue > 0) {
//
// Write remaining data, if any
//
if (BufferDesc.Cnt != 0) {
SEGGER_RTT_Write(BufferIndex, acBuffer, BufferDesc.Cnt);
}
BufferDesc.ReturnValue += BufferDesc.Cnt;
}
return BufferDesc.ReturnValue;
}
/*********************************************************************
*
* SEGGER_RTT_printf
*
* Function description
* Stores a formatted string in SEGGER RTT control block.
* This data is read by the host.
*
* Parameters
* BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
* sFormat Pointer to format string, followed by the arguments for conversion
*
* Return values
* >= 0: Number of bytes which have been stored in the "Up"-buffer.
* < 0: Error
*
* Notes
* (1) Conversion specifications have following syntax:
* %[flags][FieldWidth][.Precision]ConversionSpecifier
* (2) Supported flags:
* -: Left justify within the field width
* +: Always print sign extension for signed conversions
* 0: Pad with 0 instead of spaces. Ignored when using '-'-flag or precision
* Supported conversion specifiers:
* c: Print the argument as one char
* d: Print the argument as a signed integer
* u: Print the argument as an unsigned integer
* x: Print the argument as an hexadecimal integer
* s: Print the string pointed to by the argument
* p: Print the argument as an 8-digit hexadecimal integer. (Argument shall be a pointer to void.)
*/
int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...) {
va_list ParamList;
va_start(ParamList, sFormat);
return SEGGER_RTT_vprintf(BufferIndex, sFormat, &ParamList);
}
/*************************** End of file ****************************/
@@ -0,0 +1,68 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014 SEGGER Microcontroller GmbH & Co KG *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : RTT_Syscalls.c
Purpose : Low-level functions for using printf() via RTT in GCC
-------- END-OF-HEADER ---------------------------------------------
*/
#include <stdlib.h>
#include "SEGGER_RTT.h"
/*********************************************************************
*
* Function prototypes
*
**********************************************************************
*/
int _write(int file, char *ptr, int len);
int _write_r(struct _reent *r, int file, char *ptr, int len);
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
/*********************************************************************
*
* _write()
*
* Function description
* Low-level write function.
* libc subroutines will use this system routine for output to all files,
* including stdout.
* Write data via RTT.
*/
int _write(int file, char *ptr, int len) {
(void) file; /* Not used, avoid warning */
SEGGER_RTT_Write(0, ptr, len);
return len;
}
/*********************************************************************
*
* _write_r()
*
* Function description
* Low-level reentrant write function.
* libc subroutines will use this system routine for output to all files,
* including stdout.
* Write data via RTT.
*/
int _write_r(struct _reent *r, int file, char *ptr, int len) {
(void) file; /* Not used, avoid warning */
(void) r; /* Not used, avoid warning */
SEGGER_RTT_Write(0, ptr, len);
return len;
}
@@ -0,0 +1,52 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014 SEGGER Microcontroller GmbH & Co KG *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : RTT_Syscalls.c
Purpose : Low-level functions for using printf() via RTT in IAR
-------- END-OF-HEADER ---------------------------------------------
*/
#include <yfuns.h>
#include "SEGGER_RTT.h"
#pragma module_name = "?__write"
/*********************************************************************
*
* Function prototypes
*
**********************************************************************
*/
size_t __write(int handle, const unsigned char * buffer, size_t size);
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
/*********************************************************************
*
* __write()
*
* Function description
* Low-level write function.
* libc subroutines will use this system routine for output to all files,
* including stdout.
* Write data via RTT.
*/
size_t __write(int handle, const unsigned char * buffer, size_t size) {
(void) handle; /* Not used, avoid warning */
SEGGER_RTT_Write(0, buffer, size);
return size;
}
/****** End Of File *************************************************/
@@ -0,0 +1,311 @@
/* clang-format off */
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014 SEGGER Microcontroller GmbH & Co KG *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : RTT_Syscalls_KEIL.c
Purpose : Retargeting module for KEIL MDK-CM3.
Low-level functions for using printf() via RTT
--------- END-OF-HEADER --------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rt_sys.h>
#include <rt_misc.h>
#include "SEGGER_RTT.h"
/*********************************************************************
*
* #pragmas
*
**********************************************************************
*/
#pragma import(__use_no_semihosting)
#ifdef _MICROLIB
#pragma import(__use_full_stdio)
#endif
/*********************************************************************
*
* Defines non-configurable
*
**********************************************************************
*/
/* Standard IO device handles - arbitrary, but any real file system handles must be
less than 0x8000. */
#define STDIN 0x8001 // Standard Input Stream
#define STDOUT 0x8002 // Standard Output Stream
#define STDERR 0x8003 // Standard Error Stream
/*********************************************************************
*
* Public const
*
**********************************************************************
*/
const char __stdin_name[] = "STDIN";
const char __stdout_name[] = "STDOUT";
const char __stderr_name[] = "STDERR";
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* _ttywrch
*
* Function description:
* Outputs a character to the console
*
* Parameters:
* c - character to output
*
*/
void _ttywrch(int c) {
fputc(c, stdout); // stdout
fflush(stdout);
}
/*********************************************************************
*
* _sys_open
*
* Function description:
* Opens the device/file in order to do read/write operations
*
* Parameters:
* sName - sName of the device/file to open
* OpenMode - This parameter is currently ignored
*
* Return value:
* != 0 - Handle to the object to open, otherwise
* == 0 -"device" is not handled by this module
*
*/
FILEHANDLE _sys_open(const char * sName, int OpenMode) {
// Register standard Input Output devices.
if (strcmp(sName, __stdout_name) == 0) {
return (STDOUT);
} else if (strcmp(sName, __stderr_name) == 0) {
return (STDERR);
} else
return (0); // Not implemented
}
/*********************************************************************
*
* _sys_close
*
* Function description:
* Closes the handle to the open device/file
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
*
* Return value:
* 0 - device/file closed
*
*/
int _sys_close(FILEHANDLE hFile) {
return 0; // Not implemented
}
/*********************************************************************
*
* _sys_write
*
* Function description:
* Writes the data to an open handle.
* Currently this function only outputs data to the console
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
* pBuffer - Pointer to the data that shall be written
* NumBytes - Number of bytes to write
* Mode - The Mode that shall be used
*
* Return value:
* Number of bytes *not* written to the file/device
*
*/
int _sys_write(FILEHANDLE hFile, const unsigned char * pBuffer, unsigned NumBytes, int Mode) {
int r = 0;
if (hFile == STDOUT) {
return NumBytes - SEGGER_RTT_Write(0, (const char*)pBuffer, NumBytes);
}
return r;
}
/*********************************************************************
*
* _sys_read
*
* Function description:
* Reads data from an open handle.
* Currently this modules does nothing.
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
* pBuffer - Pointer to buffer to store the read data
* NumBytes - Number of bytes to read
* Mode - The Mode that shall be used
*
* Return value:
* Number of bytes read from the file/device
*
*/
int _sys_read(FILEHANDLE hFile, unsigned char * pBuffer, unsigned NumBytes, int Mode) {
return (0); // Not implemented
}
/*********************************************************************
*
* _sys_istty
*
* Function description:
* This function shall return whether the opened file
* is a console device or not.
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
*
* Return value:
* 1 - Device is a console
* 0 - Device is not a console
*
*/
int _sys_istty(FILEHANDLE hFile) {
if (hFile > 0x8000) {
return (1);
}
return (0); // Not implemented
}
/*********************************************************************
*
* _sys_seek
*
* Function description:
* Seeks via the file to a specific position
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
* Pos -
*
* Return value:
* int -
*
*/
int _sys_seek(FILEHANDLE hFile, long Pos) {
return (0); // Not implemented
}
/*********************************************************************
*
* _sys_ensure
*
* Function description:
*
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
*
* Return value:
* int -
*
*/
int _sys_ensure(FILEHANDLE hFile) {
return (-1); // Not implemented
}
/*********************************************************************
*
* _sys_flen
*
* Function description:
* Returns the length of the opened file handle
*
* Parameters:
* hFile - Handle to a file opened via _sys_open
*
* Return value:
* Length of the file
*
*/
long _sys_flen(FILEHANDLE hFile) {
return (0); // Not implemented
}
/*********************************************************************
*
* _sys_tmpnam
*
* Function description:
* This function converts the file number fileno for a temporary
* file to a unique filename, for example, tmp0001.
*
* Parameters:
* pBuffer - Pointer to a buffer to store the name
* FileNum - file number to convert
* MaxLen - Size of the buffer
*
* Return value:
* 1 - Error
* 0 - Success
*
*/
int _sys_tmpnam(char * pBuffer, int FileNum, unsigned MaxLen) {
return (1); // Not implemented
}
/*********************************************************************
*
* _sys_command_string
*
* Function description:
* This function shall execute a system command.
*
* Parameters:
* cmd - Pointer to the command string
* len - Length of the string
*
* Return value:
* == NULL - Command was not successfully executed
* == sCmd - Command was passed successfully
*
*/
char * _sys_command_string(char * cmd, int len) {
return cmd; // Not implemented
}
/*********************************************************************
*
* _sys_exit
*
* Function description:
* This function is called when the application returns from main
*
* Parameters:
* ReturnCode - Return code from the main function
*
*
*/
void _sys_exit(int ReturnCode) {
while (1); // Not implemented
}
+204
View File
@@ -0,0 +1,204 @@
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
/* clang-format off */
#ifndef SDK_CONFIG_H__
#define SDK_CONFIG_H__
/**
* @defgroup sdk_config SDK Configuration
* @{
* @ingroup sdk_common
* @{
* @details All parameters that allow configuring/tuning the SDK based on application/ use case
* are defined here.
*/
/**
* @defgroup mem_manager_config Memory Manager Configuration
* @{
* @addtogroup sdk_config
* @{
* @details This section defines configuration of memory manager module.
*/
/**
* @brief Maximum memory blocks identified as 'small' blocks.
*
* @details Maximum memory blocks identified as 'small' blocks.
* Minimum value : 0 (Setting to 0 disables all 'small' blocks)
* Maximum value : 255
* Dependencies : None.
*/
#define MEMORY_MANAGER_SMALL_BLOCK_COUNT 8
/**
* @brief Size of each memory blocks identified as 'small' block.
*
* @details Size of each memory blocks identified as 'small' block.
* Memory block are recommended to be word-sized.
* Minimum value : 32
* Maximum value : A value less than the next pool size. If only small pool is used, this
* can be any value based on availability of RAM.
* Dependencies : MEMORY_MANAGER_SMALL_BLOCK_COUNT is non-zero.
*/
#define MEMORY_MANAGER_SMALL_BLOCK_SIZE 128
/**
* @brief Maximum memory blocks identified as 'medium' blocks.
*
* @details Maximum memory blocks identified as 'medium' blocks.
* Minimum value : 0 (Setting to 0 disables all 'medium' blocks)
* Maximum value : 255
* Dependencies : None.
*/
#define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 4
/**
* @brief Size of each memory blocks identified as 'medium' block.
*
* @details Size of each memory blocks identified as 'medium' block.
* Memory block are recommended to be word-sized.
* Minimum value : A value greater than the small pool size if defined, else 32.
* Maximum value : A value less than the next pool size. If only medium pool is used, this
* can be any value based on availability of RAM.
* Dependencies : MEMORY_MANAGER_MEDIUM_BLOCK_COUNT is non-zero.
*/
#define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256
/**
* @brief Maximum memory blocks identified as 'medium' blocks.
*
* @details Maximum memory blocks identified as 'medium' blocks.
* Minimum value : 0 (Setting to 0 disables all 'large' blocks)
* Maximum value : 255
* Dependencies : None.
*/
#define MEMORY_MANAGER_LARGE_BLOCK_COUNT 3
/**
* @brief Size of each memory blocks identified as 'medium' block.
*
* @details Size of each memory blocks identified as 'medium' block.
* Memory block are recommended to be word-sized.
* Minimum value : A value greater than the small &/ medium pool size if defined, else 32.
* Maximum value : Any value based on availability of RAM.
* Dependencies : MEMORY_MANAGER_MEDIUM_BLOCK_COUNT is non-zero.
*/
#define MEMORY_MANAGER_LARGE_BLOCK_SIZE 1024
/**
* @brief Disable debug trace in the module.
*
* @details Set this define to 1 to enable debug trace in the module, else set to 0.
* Possible values : 0 or 1.
* Dependencies : ENABLE_DEBUG_LOG_SUPPORT. If this flag is not defined, no
* trace is observed even if this define is set to 1.
*/
#define MEM_MANAGER_DISABLE_LOGS 1
/**
* @brief Disables API parameter checks in the module.
*
* @details Set this define to 1 to disable checks on API parameters in the module.
* API parameter checks are added to ensure right parameters are passed to the
* module. These checks are useful during development phase but be redundant
* once application is developed. Disabling this can result in some code saving.
* Possible values : 0 or 1.
* Dependencies : None.
*/
#define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0
/** @} */
/** @} */
/**
* @defgroup iot_context_manager Context Manager Configurations.
* @{
* @addtogroup iot_config
* @{
* @details This section defines configuration of Context Manager.
*/
/**
* @brief Disable debug trace in the module.
*
* @details Set this define to 1 to enable debug trace in the module, else set to 0.
* Possible values : 0 or 1.
* Dependencies : ENABLE_DEBUG_LOG_SUPPORT. If this flag is not defined, no
* trace is observed even if this define is set to 1.
*/
#define IOT_CONTEXT_MANAGER_DISABLE_LOGS 1
/**
* @brief Disables API parameter checks in the module.
*
* @details Set this define to 1 to disable checks on API parameters in the module.
* API parameter checks are added to ensure right parameters are passed to the
* module. These checks are useful during development phase but be redundant
* once application is developed. Disabling this can result in some code saving.
* Possible values : 0 or 1.
* Dependencies : None.
*/
#define IOT_CONTEXT_MANAGER_DISABLE_API_PARAM_CHECK 0
/**
* @brief Maximum number of supported context identifiers.
*
* @details Maximum value of 16 is preferable to correct decompression.
* Minimum value : 1
* Maximum value : 16
* Dependencies : None.
*/
#define IOT_CONTEXT_MANAGER_MAX_CONTEXTS 16
/**
* @brief Maximum number of supported context's table.
*
* @details If value is equal to BLE_IPSP_MAX_CHANNELS then all interface will have
* its own table which is preferable.
* Minimum value : 1
* Maximum value : BLE_IPSP_MAX_CHANNELS
* Dependencies : None.
*/
#define IOT_CONTEXT_MANAGER_MAX_TABLES 1
/** @} */
/** @} */
/**
* @defgroup lwip_nrf51_driver nRF51 lwIP driver
* @{
* @addtogroup iot_config
* @{
* @details This section defines configuration of nRF51 lwIP driver.
*/
/**
* @brief Disable debug trace in the module.
*
* @details Set this define to 1 to enable debug trace in the module, else set to 0.
* Possible values : 0 or 1.
* Dependencies : ENABLE_DEBUG_LOG_SUPPORT. If this flag is not defined, no
* trace is observed even if this define is set to 1.
*/
#define NRF51_LWIP_DRIVER_DISABLE_LOGS 1
/** @} */
/** @} */
/** @} */
/** @} */
#endif // SDK_CONFIG_H__