Fork of mbed-src file paths change. LPC1114FN28 use only.
Fork of mbed-src by
Information
この情報は2013/10/28時点での解決方法です。
現在はmbed-src、標準ライブラリで問題なくコンパイルが可能です。
・使う物
LPC1114FN28
mbed SDK
LPC1114FN28でmbed-SDKのLibraryを使うとCompile出来ない。(2013/10/28)
パスが通ってないだけのようなのでファイルを以下に移動する。
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\ |
へ移動
移動後は以下のような構成になると思います。
※不要なファイルは削除してあります。
ファイルの移動が面倒なので以下に本家からフォークしたライブラリを置いておきます。
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されるため上記のエラーになるようです。
common/CAN.cpp@43:b3acfef78949, 2013-10-27 (annotated)
- Committer:
- minicube
- Date:
- Sun Oct 27 20:12:31 2013 +0000
- Revision:
- 43:b3acfef78949
- Parent:
- 41:e8b66477f5bf
mbed SDK; LPC1114FN28 use only
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 13:0645d8841f51 | 1 | /* mbed Microcontroller Library |
bogdanm | 13:0645d8841f51 | 2 | * Copyright (c) 2006-2013 ARM Limited |
bogdanm | 13:0645d8841f51 | 3 | * |
bogdanm | 13:0645d8841f51 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
bogdanm | 13:0645d8841f51 | 5 | * you may not use this file except in compliance with the License. |
bogdanm | 13:0645d8841f51 | 6 | * You may obtain a copy of the License at |
bogdanm | 13:0645d8841f51 | 7 | * |
bogdanm | 13:0645d8841f51 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
bogdanm | 13:0645d8841f51 | 9 | * |
bogdanm | 13:0645d8841f51 | 10 | * Unless required by applicable law or agreed to in writing, software |
bogdanm | 13:0645d8841f51 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
bogdanm | 13:0645d8841f51 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
bogdanm | 13:0645d8841f51 | 13 | * See the License for the specific language governing permissions and |
bogdanm | 13:0645d8841f51 | 14 | * limitations under the License. |
bogdanm | 13:0645d8841f51 | 15 | */ |
bogdanm | 13:0645d8841f51 | 16 | #include "CAN.h" |
bogdanm | 13:0645d8841f51 | 17 | |
bogdanm | 13:0645d8841f51 | 18 | #if DEVICE_CAN |
bogdanm | 13:0645d8841f51 | 19 | |
bogdanm | 13:0645d8841f51 | 20 | #include "cmsis.h" |
bogdanm | 13:0645d8841f51 | 21 | |
bogdanm | 13:0645d8841f51 | 22 | namespace mbed { |
bogdanm | 13:0645d8841f51 | 23 | |
bogdanm | 13:0645d8841f51 | 24 | CAN::CAN(PinName rd, PinName td) { |
bogdanm | 13:0645d8841f51 | 25 | can_init(&_can, rd, td); |
bogdanm | 15:4892fe388435 | 26 | can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this); |
bogdanm | 13:0645d8841f51 | 27 | } |
bogdanm | 13:0645d8841f51 | 28 | |
bogdanm | 13:0645d8841f51 | 29 | CAN::~CAN() { |
bogdanm | 13:0645d8841f51 | 30 | can_free(&_can); |
bogdanm | 15:4892fe388435 | 31 | can_irq_free(&_can); |
bogdanm | 13:0645d8841f51 | 32 | } |
bogdanm | 13:0645d8841f51 | 33 | |
bogdanm | 13:0645d8841f51 | 34 | int CAN::frequency(int f) { |
bogdanm | 13:0645d8841f51 | 35 | return can_frequency(&_can, f); |
bogdanm | 13:0645d8841f51 | 36 | } |
bogdanm | 13:0645d8841f51 | 37 | |
bogdanm | 13:0645d8841f51 | 38 | int CAN::write(CANMessage msg) { |
bogdanm | 13:0645d8841f51 | 39 | return can_write(&_can, msg, 0); |
bogdanm | 13:0645d8841f51 | 40 | } |
bogdanm | 13:0645d8841f51 | 41 | |
mbed_official | 41:e8b66477f5bf | 42 | int CAN::read(CANMessage &msg, int handle) { |
mbed_official | 41:e8b66477f5bf | 43 | return can_read(&_can, &msg, handle); |
bogdanm | 13:0645d8841f51 | 44 | } |
bogdanm | 13:0645d8841f51 | 45 | |
bogdanm | 13:0645d8841f51 | 46 | void CAN::reset() { |
bogdanm | 13:0645d8841f51 | 47 | can_reset(&_can); |
bogdanm | 13:0645d8841f51 | 48 | } |
bogdanm | 13:0645d8841f51 | 49 | |
bogdanm | 13:0645d8841f51 | 50 | unsigned char CAN::rderror() { |
bogdanm | 13:0645d8841f51 | 51 | return can_rderror(&_can); |
bogdanm | 13:0645d8841f51 | 52 | } |
bogdanm | 13:0645d8841f51 | 53 | |
bogdanm | 13:0645d8841f51 | 54 | unsigned char CAN::tderror() { |
bogdanm | 13:0645d8841f51 | 55 | return can_tderror(&_can); |
bogdanm | 13:0645d8841f51 | 56 | } |
bogdanm | 13:0645d8841f51 | 57 | |
bogdanm | 13:0645d8841f51 | 58 | void CAN::monitor(bool silent) { |
bogdanm | 13:0645d8841f51 | 59 | can_monitor(&_can, (silent) ? 1 : 0); |
bogdanm | 13:0645d8841f51 | 60 | } |
bogdanm | 13:0645d8841f51 | 61 | |
bogdanm | 15:4892fe388435 | 62 | int CAN::mode(Mode mode) { |
bogdanm | 15:4892fe388435 | 63 | return can_mode(&_can, (CanMode)mode); |
bogdanm | 15:4892fe388435 | 64 | } |
bogdanm | 13:0645d8841f51 | 65 | |
mbed_official | 41:e8b66477f5bf | 66 | int CAN::filter(unsigned int id, unsigned int mask, CANFormat format, int handle) { |
mbed_official | 41:e8b66477f5bf | 67 | return can_filter(&_can, id, mask, format, handle); |
mbed_official | 41:e8b66477f5bf | 68 | } |
mbed_official | 41:e8b66477f5bf | 69 | |
mbed_official | 41:e8b66477f5bf | 70 | void CAN::attach(void (*fptr)(void), IrqType type) { |
mbed_official | 41:e8b66477f5bf | 71 | if (fptr) { |
mbed_official | 41:e8b66477f5bf | 72 | _irq[(CanIrqType)type].attach(fptr); |
mbed_official | 41:e8b66477f5bf | 73 | can_irq_set(&_can, (CanIrqType)type, 1); |
mbed_official | 41:e8b66477f5bf | 74 | } else { |
mbed_official | 41:e8b66477f5bf | 75 | can_irq_set(&_can, (CanIrqType)type, 0); |
bogdanm | 13:0645d8841f51 | 76 | } |
mbed_official | 41:e8b66477f5bf | 77 | } |
bogdanm | 13:0645d8841f51 | 78 | |
mbed_official | 41:e8b66477f5bf | 79 | void CAN::_irq_handler(uint32_t id, CanIrqType type) { |
mbed_official | 41:e8b66477f5bf | 80 | CAN *handler = (CAN*)id; |
mbed_official | 41:e8b66477f5bf | 81 | handler->_irq[type].call(); |
mbed_official | 41:e8b66477f5bf | 82 | } |
bogdanm | 13:0645d8841f51 | 83 | |
bogdanm | 13:0645d8841f51 | 84 | } // namespace mbed |
bogdanm | 13:0645d8841f51 | 85 | |
bogdanm | 13:0645d8841f51 | 86 | #endif |