You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2015/12/11 01:09:29 UTC
[1/2] incubator-mynewt-larva git commit: Add nzbss memory section for
nrf52.
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master c45b1c4ac -> c855c828c
Add nzbss memory section for nrf52.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6b03f8e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6b03f8e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6b03f8e2
Branch: refs/heads/master
Commit: 6b03f8e29d4e99bbc7a382b5561939184a7fdd70
Parents: c45b1c4
Author: Christopher Collins <cc...@gmail.com>
Authored: Thu Dec 10 16:08:35 2015 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Thu Dec 10 16:08:35 2015 -0800
----------------------------------------------------------------------
hw/bsp/nrf52pdk/nrf52pdk.ld | 38 +++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6b03f8e2/hw/bsp/nrf52pdk/nrf52pdk.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52pdk/nrf52pdk.ld b/hw/bsp/nrf52pdk/nrf52pdk.ld
index 144ea23..66188f1 100755
--- a/hw/bsp/nrf52pdk/nrf52pdk.ld
+++ b/hw/bsp/nrf52pdk/nrf52pdk.ld
@@ -33,12 +33,6 @@
*/
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
-/*
- * NOTE: This linker script is for version 1.0 of the nrf52. See
- * errata #33 and #34 on nordic infocenter website for details. This errata
- * causes us to allocate a memory regision we call "CODE_RAM" so that we can
- * access the full 64K RAM provided by the chip.
- */
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
@@ -65,13 +59,13 @@ MEMORY
* __data_end__
* __bss_start__
* __bss_end__
- * __end__
- * end
* __HeapBase
* __HeapLimit
* __StackLimit
* __StackTop
* __stack
+ * __nzbss_start__
+ * __nzbss_end__
*/
ENTRY(Reset_Handler)
@@ -175,20 +169,20 @@ SECTIONS
__bss_end__ = .;
} > RAM
+ /* Heap starts after BSS */
+ __HeapBase = .;
+
/* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later */
.stack_dummy (COPY):
{
*(.stack*)
- } > CODE_RAM
+ } > RAM
- /*
- * Place heap and stack in CODE_RAM. Heap is at start, stack is at the
- * top and stack limit is the bottom of the stack.
- */
- __HeapBase = ORIGIN(CODE_RAM);
- __StackTop = ORIGIN(CODE_RAM) + LENGTH(CODE_RAM);
+ /* Set stack top to end of RAM, and stack limit move down by
+ * size of stack_dummy section */
+ __StackTop = ORIGIN(RAM) + LENGTH(RAM);
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
@@ -197,5 +191,19 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
+
+ /* Non-zeroed BSS. This section is similar to BSS, with the following two
+ * caveats:
+ * 1. It does not get zeroed at init-time.
+ * 2. You cannot use it as source memory for EasyDMA.
+ */
+ .nzbss :
+ {
+ . = ALIGN(4);
+ __nzbss_start__ = .;
+ *(.nzbss*)
+ . = ALIGN(4);
+ __nzbss_end__ = .;
+ } > CODE_RAM
}
[2/2] incubator-mynewt-larva git commit: Move ble host membufs from
heap to bss.
Posted by cc...@apache.org.
Move ble host membufs from heap to bss.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/c855c828
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/c855c828
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/c855c828
Branch: refs/heads/master
Commit: c855c828c19fcde38c4604d1ca7fdfc96f795de0
Parents: 6b03f8e
Author: Christopher Collins <cc...@gmail.com>
Authored: Thu Dec 10 16:08:57 2015 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Thu Dec 10 16:08:57 2015 -0800
----------------------------------------------------------------------
net/nimble/host/src/ble_hs.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/c855c828/net/nimble/host/src/ble_hs.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs.c b/net/nimble/host/src/ble_hs.c
index 984630e..b6b2813 100644
--- a/net/nimble/host/src/ble_hs.c
+++ b/net/nimble/host/src/ble_hs.c
@@ -56,7 +56,7 @@ static os_membuf_t g_hci_cmd_buf[OS_MEMPOOL_BYTES(HCI_CMD_BUFS,
sizeof(struct os_mbuf_pkthdr))
#define BLE_HS_MBUF_MEMPOOL_SIZE \
- OS_MEMPOOL_BYTES(BLE_HS_NUM_MBUFS, BLE_HS_MBUF_MEMBLOCK_SIZE)
+ OS_MEMPOOL_SIZE(BLE_HS_NUM_MBUFS, BLE_HS_MBUF_MEMBLOCK_SIZE)
#define BLE_HS_PKT_MAX BLE_HS_NUM_MBUFS
@@ -64,7 +64,7 @@ struct os_mempool g_hci_os_event_pool;
static os_membuf_t g_hci_os_event_buf[OS_MEMPOOL_BYTES(HCI_NUM_OS_EVENTS,
HCI_OS_EVENT_BUF_SIZE)];
-static os_membuf_t *ble_hs_mbuf_mem;
+static os_membuf_t ble_hs_mbuf_mem[BLE_HS_MBUF_MEMPOOL_SIZE];
static struct os_mempool ble_hs_mbuf_mempool;
struct os_mbuf_pool ble_hs_mbuf_pool;
@@ -246,9 +246,6 @@ ble_hs_free_mem(void)
{
free(ble_hs_pkt_mem);
ble_hs_pkt_mem = NULL;
-
- free(ble_hs_mbuf_mem);
- ble_hs_mbuf_mem = NULL;
}
/**
@@ -278,11 +275,6 @@ ble_hs_init(uint8_t prio)
host_hci_init();
- ble_hs_mbuf_mem = malloc(BLE_HS_MBUF_MEMPOOL_SIZE);
- if (ble_hs_mbuf_mem == NULL) {
- rc = BLE_HS_ENOMEM;
- goto err;
- }
rc = os_mempool_init(&ble_hs_mbuf_mempool, BLE_HS_NUM_MBUFS,
BLE_HS_MBUF_MEMBLOCK_SIZE,
ble_hs_mbuf_mem, "ble_hs_mbuf_pool");