Fork of mbed-src file paths change. LPC1114FN28 use only.

Fork of mbed-src by mbed official

Information

この情報は2013/10/28時点での解決方法です。
現在はmbed-src、標準ライブラリで問題なくコンパイルが可能です。

・使う物
LPC1114FN28
mbed SDK

LPC1114FN28でmbed-SDKのLibraryを使うとCompile出来ない。(2013/10/28) /media/uploads/minicube/mbed_lpc1114_sdk.png

パスが通ってないだけのようなのでファイルを以下に移動する。

mbed-src\targets\cmsis\TARGET_NXP\TARGET_LPC11XX_11CXX\
mbed-src\targets\cmsis\TARGET_NXP\TARGET_LPC11XX_11CXX\TARGET_LPC11XX\

にあるファイルをすべて

mbed-src\targets\cmsis\TARGET_NXP\

へ移動

mbed-src\targets\cmsis\TARGET_NXP\TARGET_LPC11XX_11CXX\にある

TOOLCHAIN_ARM_MICRO

をフォルダごと

mbed-src\targets\cmsis\TARGET_NXP\

へ移動

mbed-src\targets\hal\TARGET_NXP\TARGET_LPC11XX_11CXX\
mbed-src\targets\hal\TARGET_NXP\TARGET_LPC11XX_11CXX\TARGET_LPC11XX\

にあるファイルをすべて

mbed-src\targets\hal\TARGET_NXP\

へ移動

移動後は以下のような構成になると思います。
※不要なファイルは削除してあります。

/media/uploads/minicube/mbed_lpc1114_sdk_tree.png


ファイルの移動が面倒なので以下に本家からフォークしたライブラリを置いておきます。

Import librarymbed-src-LPC1114FN28

Fork of mbed-src file paths change. LPC1114FN28 use only.


エラーが出力される場合

"TOOLCHAIN_ARM_MICRO"が無いとエラーになる。

Error: Undefined symbol _initial_sp (referred from entry2.o).
Error: Undefined symbol _heap_base (referred from malloc.o).
Error: Undefined symbol _heap_limit (referred from malloc.o).

LPC1114FN28はMicrolibを使ってCompileされるため上記のエラーになるようです。

Committer:
minicube
Date:
Sun Oct 27 20:12:31 2013 +0000
Revision:
43:b3acfef78949
Parent:
targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c@30:91c1d09ada54
mbed SDK; LPC1114FN28 use only

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 30:91c1d09ada54 1 /* mbed Microcontroller Library
mbed_official 30:91c1d09ada54 2 * Copyright (c) 2006-2013 ARM Limited
mbed_official 30:91c1d09ada54 3 *
mbed_official 30:91c1d09ada54 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbed_official 30:91c1d09ada54 5 * you may not use this file except in compliance with the License.
mbed_official 30:91c1d09ada54 6 * You may obtain a copy of the License at
mbed_official 30:91c1d09ada54 7 *
mbed_official 30:91c1d09ada54 8 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 30:91c1d09ada54 9 *
mbed_official 30:91c1d09ada54 10 * Unless required by applicable law or agreed to in writing, software
mbed_official 30:91c1d09ada54 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbed_official 30:91c1d09ada54 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 30:91c1d09ada54 13 * See the License for the specific language governing permissions and
mbed_official 30:91c1d09ada54 14 * limitations under the License.
mbed_official 30:91c1d09ada54 15 */
mbed_official 30:91c1d09ada54 16 #include "sleep_api.h"
mbed_official 30:91c1d09ada54 17 #include "cmsis.h"
mbed_official 30:91c1d09ada54 18 #include "mbed_interface.h"
mbed_official 30:91c1d09ada54 19
mbed_official 30:91c1d09ada54 20 void sleep(void) {
mbed_official 30:91c1d09ada54 21 #if DEVICE_SEMIHOST
mbed_official 30:91c1d09ada54 22 // ensure debug is disconnected
mbed_official 30:91c1d09ada54 23 mbed_interface_disconnect();
mbed_official 30:91c1d09ada54 24 #endif
mbed_official 30:91c1d09ada54 25
mbed_official 30:91c1d09ada54 26 // PCON[DPDEN] set to sleep
mbed_official 30:91c1d09ada54 27 LPC_PMU->PCON = 0x0;
mbed_official 30:91c1d09ada54 28
mbed_official 30:91c1d09ada54 29 // SRC[SLEEPDEEP] set to 0 = sleep
mbed_official 30:91c1d09ada54 30 SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
mbed_official 30:91c1d09ada54 31
mbed_official 30:91c1d09ada54 32 // wait for interrupt
mbed_official 30:91c1d09ada54 33 __WFI();
mbed_official 30:91c1d09ada54 34 }
mbed_official 30:91c1d09ada54 35
mbed_official 30:91c1d09ada54 36 /*
mbed_official 30:91c1d09ada54 37 * The mbed lpc1768 does not support the deepsleep mode
mbed_official 30:91c1d09ada54 38 * as a debugger is connected to it (the mbed interface).
mbed_official 30:91c1d09ada54 39 *
mbed_official 30:91c1d09ada54 40 * As mentionned in an application note from NXP:
mbed_official 30:91c1d09ada54 41 *
mbed_official 30:91c1d09ada54 42 * http://www.po-star.com/public/uploads/20120319123122_141.pdf
mbed_official 30:91c1d09ada54 43 *
mbed_official 30:91c1d09ada54 44 * {{{
mbed_official 30:91c1d09ada54 45 * The user should be aware of certain limitations during debugging.
mbed_official 30:91c1d09ada54 46 * The most important is that, due to limitations of the Cortex-M3
mbed_official 30:91c1d09ada54 47 * integration, the LPC17xx cannot wake up in the usual manner from
mbed_official 30:91c1d09ada54 48 * Deep Sleep and Power-down modes. It is recommended not to use these
mbed_official 30:91c1d09ada54 49 * modes during debug. Once an application is downloaded via JTAG/SWD
mbed_official 30:91c1d09ada54 50 * interface, the USB to SWD/JTAG debug adapter (Keil ULINK2 for example)
mbed_official 30:91c1d09ada54 51 * should be removed from the target board, and thereafter, power cycle
mbed_official 30:91c1d09ada54 52 * the LPC17xx to allow wake-up from deep sleep and power-down modes
mbed_official 30:91c1d09ada54 53 * }}}
mbed_official 30:91c1d09ada54 54 *
mbed_official 30:91c1d09ada54 55 * As the interface firmware does not reset the target when a
mbed_official 30:91c1d09ada54 56 * mbed_interface_disconnect() semihosting call is made, the
mbed_official 30:91c1d09ada54 57 * core cannot wake-up from deepsleep.
mbed_official 30:91c1d09ada54 58 *
mbed_official 30:91c1d09ada54 59 * We treat a deepsleep() as a normal sleep().
mbed_official 30:91c1d09ada54 60 */
mbed_official 30:91c1d09ada54 61
mbed_official 30:91c1d09ada54 62 void deepsleep(void) {
mbed_official 30:91c1d09ada54 63 #if DEVICE_SEMIHOST
mbed_official 30:91c1d09ada54 64 // ensure debug is disconnected
mbed_official 30:91c1d09ada54 65 mbed_interface_disconnect();
mbed_official 30:91c1d09ada54 66 #endif
mbed_official 30:91c1d09ada54 67
mbed_official 30:91c1d09ada54 68 // PCON[DPDEN] set to deepsleep
mbed_official 30:91c1d09ada54 69 LPC_PMU->PCON = 0x2;
mbed_official 30:91c1d09ada54 70
mbed_official 30:91c1d09ada54 71 // SRC[SLEEPDEEP] set to 1 = deep sleep
mbed_official 30:91c1d09ada54 72 SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
mbed_official 30:91c1d09ada54 73
mbed_official 30:91c1d09ada54 74 // Power up everything after powerdown
mbed_official 30:91c1d09ada54 75 LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800;
mbed_official 30:91c1d09ada54 76
mbed_official 30:91c1d09ada54 77 // wait for interrupt
mbed_official 30:91c1d09ada54 78 __WFI();
mbed_official 30:91c1d09ada54 79 }