Commit Graph

2867 Commits (1874247540ee1b000468c99a9721eee1ff4e8c4b)

Author SHA1 Message Date
Bogdan Marinescu 162aad2072 Changed do_sync do return the list of changed repositories 2013-09-11 13:10:11 +03:00
Bogdan Marinescu 5ec4edf76f Change the synch.py script to make it usable as a module 2013-09-11 12:59:28 +03:00
ytsuboi a693ad6d06 Merge branch 'master' of https://github.com/ytsuboi/mbed 2013-09-11 02:30:33 +09:00
ytsuboi f79b9d3430 [LPC812] Added RTOS support 2013-09-11 02:30:27 +09:00
Bogdan Marinescu 12d085ec0a Updated synchronization script
Added persistent line endings, commit message on the command line and
"quiet" option (run without user interaction).
2013-09-10 18:27:10 +03:00
Bogdan Marinescu 171dda705c Merge pull request #63 from jorisa/master
Fix hardfault when attaching callback to CAN2 when CAN1 is not defined
2013-09-10 03:22:55 -07:00
Joris Aerts efd3d8d8e0 Fix hardfault when attaching callback to CAN2 when CAN1 is not defined
Fault is triggered by trying to read LPC_CAN1->IER when the peripheral is powered off. Fixed by checking the power control register before checking the IER register.
2013-09-09 09:06:04 -07:00
Bogdan Marinescu cfa6a1d912 Merge pull request #61 from ytsuboi/master
Fixed problem in PWMOUT mapping table
2013-09-09 08:22:11 -07:00
Andreas Rebert 00cfdbad2a Merge remote-tracking branch 'upstream/master' into lpc4088 2013-09-09 14:13:08 +02:00
Andreas Rebert cbab9bbfc5 Added: Export to uVision and Code Red toolchains 2013-09-09 14:12:39 +02:00
unknown 0e36bdd457 Bugfix: PIN Modes was not set correctly
Added: Export to uVision and Code Red toolchains
2013-09-09 14:10:11 +02:00
Bogdan Marinescu 1f243a900c Merge remote-tracking branch 'github/master' 2013-09-09 12:31:42 +03:00
Bogdan Marinescu fded46b459 [LPC1768] Fix serial_clear
serial_clear() erroneously disabled the UART FIFOs.
Reported by Adam Green.
2013-09-09 12:28:11 +03:00
Toyomasa Watarai d0d2df3ce5 Fixed problem in PWMOUT mapping table
Fixed problem in PWMOUT output issue.
Startup code cean-up (correced exception names).
Corrected test cases.
2013-09-09 18:15:51 +09:00
Bogdan Marinescu d51411294f Merge pull request #57 from adamgreen/serialTxDropsRx
serial_putc() can cause rx bytes to be dropped
2013-09-09 01:19:29 -07:00
Bogdan Marinescu 946cf742b4 Merge pull request #60 from jorisa/master
Fix MASKED_ACCESS bug in gpio_init
2013-09-09 01:07:04 -07:00
Joris Aerts 743e178455 Fix MASKED_ACCESS bug in gpio_init, now same as LPC11xx (Also use PIN_SHIFT instead of magic number 8 in gpio_set) 2013-09-08 18:57:40 -07:00
Adam Green 5d27f98c7b serial_putc() can cause rx bytes to be dropped
While fixing this issue in the various LPC* ports, I noticed a comment
pointing to this mbed forum post which summarizes this bug quite well:
  https://mbed.org/forum/bugs-suggestions/topic/4473/

This bug was introduced in the following commit:
2662e105c4

The following code was added to serial_putc() as part of this commit:
    uint32_t lsr = obj->uart->LSR;
    lsr = lsr;
    uint32_t thr = obj->uart->THR;
    thr = thr;

As the forum post indicates, this causes the serial_putc() routine to
actually eat an inbound received byte if it exists since reading THR is
really reading the RBR, the Receiver Buffer Register.  This code looks
like code that was probably added so that the developer could take a
snapshot of these registers and look at them in the debugger.  It
probably got committed in error.
2013-09-07 00:44:44 -07:00
Bogdan Marinescu e03e337af6 Fix USBDevice compilation on LPC11U24_301 and LPC11U35_401
Reported by Frank Buss <fb@frank-buss.de>
2013-09-06 12:21:38 +03:00
Bogdan Marinescu 423f1abd63 Fix startup files for various versions of LPC11Uxx
LPC11U24/LPC11U24_301/LPC11U35_401 shared the same startup file for ARM
and uARM toolchains, which is wrong, because the initial SP value is
different for LPC11U24_301. This commit fixes this issue by giving each
target its own startup file.
2013-09-06 11:50:52 +03:00
Bogdan Marinescu 95f6826196 Refactor code for LPC810/LPC812
There were lots of overlaps in the code for LPC810 and LPC812, including
duplicated source files. This commit adds a TARGET_LPC81X_COMMON folder in
both HAL and CMSIS, this folder keeps common code for the targets.
2013-09-05 19:00:19 +03:00
Bogdan Marinescu 233979e88f Merge pull request #54 from ytsuboi/master
Added LPC810 support
2013-09-05 07:00:17 -07:00
Bogdan Marinescu f813bb9382 Fix GCC interpretation of dependency file
The dependency file generated by GCC might contain more than one
dependency listed on a single line, which wasn't taken into account by the
GCC dependency fille interpreter. This commit fixes this issue.
2013-09-05 15:29:13 +03:00
Bogdan Marinescu ae16d3efa8 Fix NULL pointer indirection in FilePath
If the FileBase::lookup operation in the constructor of FilePath returns
NULL, subsequent operations (such as isFile()/isFileSystem()) will call
methods on a NULL 'fb' pointer. This commit fixes this issue by adding
explicit NULL checks and a new method in FilePath (exists()).
2013-09-05 14:09:27 +03:00
ytsuboi 46003d4c3c Merge remote-tracking branch 'upstream/master' 2013-09-05 13:01:12 +09:00
Abe Karplus 96101aed32 Added complete PwmOut mappings for KL25Z 2013-09-04 15:52:58 +03:00
Bogdan Marinescu 45565cb055 Merge pull request #48 from adamgreen/gccRetargetSbrk
gcc: Provide _sbrk implementation compatible with RTX
2013-09-04 01:12:31 -07:00
ytsuboi 0718c7671a Merge remote-tracking branch 'upstream/master' 2013-09-03 19:38:34 +09:00
Bogdan Marinescu 42e27e70b9 Merge pull request #51 from adamgreen/netMorePerformanceWork
Asm versions of netstack memcpy() and lwip_standard_chksum()

[Note] I'm generally a bit reluctant when including optimizations like this (from an architectural standpoint), because they tend to be a bit too specific (for example, this one works only with lwIP+GCC+Cortex-M3 or M4), but for now it looks as this is the right place for them, although the optimized memcpy should ideally be in libc (or even better replaced with a DMA transfer in this particular case). But this will be both a nice optimization and a reminder of what we need to implement/change in the future.
2013-09-02 04:05:56 -07:00
Bogdan Marinescu f44914d59a Merge pull request #50 from dinau/lpc2368
LPC2368 [GCC_ARM, GCC_CR]: Startup codes
2013-09-02 03:43:52 -07:00
Bogdan Marinescu c9fc35f6f3 Merge pull request #49 from dinau/link_issue
Fixed: [GCC_ARM : LPC1768] Issue ignored the linker option for _print_fl...
2013-09-02 03:14:11 -07:00
Adam Green 2056ad025e usbhost: USBHost::fileControlBuf() handle alignment and endianness
Based on great feedback from Martin Kojtal on my previous commit, I
have modified my USBHost::fileControlBuf() change to be more portable.
    ddb3fbe826 (commitcomment-3988044)

The code now fills in the setupPacket byte array a byte at a time,
using bit shifts to extract lower and upper bytes from the 16-bit
values so that the code should work on big endian or little endian
machines.  I also removed the 2-byte alignment attribute from the
setupPacket array as it is no longer required.
2013-09-01 12:19:59 -07:00
dinau 8503ccb7a3 LPC2368 [GCC_ARM, GCC_CR]:
1. Added: GCC_CR toolchain ID for LPC2368. (targets.py)
2. Modified: Startup codes for GCC_ARM and GCC_CR toolchain.
3. Verified: "ticker" and "basic" test program work well, so far.
(Fixed typo.)
2013-08-31 16:00:40 +09:00
dinau 7bcdf0b980 LPC2368 [GCC_ARM, GCC_CR]:
1. Added: GCC_CR toolchain ID for LPC2368. (targets.py)
2. Modified: Startup codes for GCC_ARM and GCC_CR toolchain.
3. Verified: "ticker" and "basic" test program works well, so far.
2013-08-31 13:33:34 +09:00
dinau 2b57e648a4 Fixed: [GCC_ARM : LPC1768] Issue ignored the linker option for _print_float and _scanf_float. 2013-08-31 11:34:53 +09:00
Adam Green 9e6d1683b8 gcc: Provide _sbrk implementation compatible with RTX
I verified that the hang issue I was seeing when building and running
the mbed official networking tests with GCC_ARM was related to this
issue reported on the mbed forums:
    http://mbed.org/forum/mbed/topic/3803/?page=1#comment-18934

If you are using the 4.7 2013q1 update of GCC_ARM or newer then it
will have a _sbrk() implementation which checks the new top of heap
pointer against the current thread SP, stack pointer.
See this GCC_ARM related thread for more information:
    https://answers.launchpad.net/gcc-arm-embedded/+question/218972
When using RTX RTOS threads, the thread's stack pointer can easily
point to an address which is below the current top of heap so this
check will incorrectly fail the allocation.

I have added a _sbrk() implementation to the mbed SDK which checks the
heap pointer against the MSP instead of the current thread SP.  I have
only enabled this for TOOLCHAIN_GCC_ARM as this is the only GCC based
toolchain that I am sure requires this.
2013-08-30 18:15:25 -07:00
Adam Green 7dddd9e578 Asm versions of netstack memcpy() and lwip_standard_chksum()
For tests such as TCPEchoServer
(http://mbed.org/users/emilmont/notebook/networking-libraries-benchmark/)
this change showed a 28% improvement (14Mbps to 18Mbps) when the echo
test was modified to instead use 1K data buffers.

I targetted these two functions based on manual profiling samples which
showed that a great deal of time was being spent in these two functions
when the network stack was being slammed with UDP packets.
2013-08-30 06:09:16 -07:00
Bogdan Marinescu e23be8a1b3 Merge pull request #46 from adamgreen/netAssertDisableAndCrashFixes2
Robustness fixes for netstack
2013-08-30 04:47:15 -07:00
Bogdan Marinescu 1798920cf4 Merge remote-tracking branch 'github/master' 2013-08-30 12:26:37 +03:00
Bogdan Marinescu e870a90ff2 Added toolchain hooks and support for LPC4088_EA binary generation
A new hooks mechanism (hooks.py) allows various targets to customize
part(s) of the build process. This was implemented to allow generation of
custom binary images for the EA LPC4088 target, but it should be generic
enough to allow other such customizations in the future. For now, only the
'binary' step is hooked in toolchains/arm.py.
2013-08-30 12:19:08 +03:00
Adam Green c0d7c3fb39 USBHost: Silence narrowing warning in USBHostMSD::inquiry
I changed the following initialization from:
    uint8_t cmd[6] = {0x12, (lun << 5) | evpd, page_code, 0, 36, 0};
to:
    uint8_t cmd[6] = {0x12, uint8_t((lun << 5) | evpd), page_code, 0, 36, 0};
This makes it clear to the compiler that we are Ok with the 32-bit
integer result from the shift and logical OR operation (after integral
promotions) being truncated down to a 8-bit unsigned value.  This is
safe as long as lun only has a value of 7 or lower.
2013-08-29 21:16:45 -07:00
Adam Green fb769b1566 USBHost: Don't pass NULL in for uint32_t parameters.
USBHostHub.cpp made a few calls to the USBHALHost::deviceDisconnected()
virtual method passing in NULL for the addr parameter which is actually
declared as uint32_t and not a pointer type.  Switching these calls
to pass in a 0 for this parameter silences GCC warnings about
incompatible types.
2013-08-29 21:12:12 -07:00
Adam Green 8281836df3 USBHost: Silence unused variable warnings.
I removed the initialization of some variables which were never used to
silence GCC warnings.

One of them had me removing the following line from
USBHostMouse::rxHandler():
    int len = int_in->getLengthTransferred();
The variable len is never used again in this method and it doesn't
appear that the int_in->getLengthTransferred() call has any side
effects which would require this extraneous call to remain in the code.
2013-08-29 21:07:43 -07:00
Adam Green ddb3fbe826 USBHost: Silence GCC warnings in USBHost.cpp
There are a few warnings thrown by GCC for this source file that I have
attempted to correct.  I would definitely appreciate feedback from
others on these changes:
* USBHost::usb_process() would attempt to write past the end of the
  deviceInited[] array in the following code snippet:
    if (i == MAX_DEVICE_CONNECTED) {
        USB_ERR("Too many device connected!!\r\n");
        deviceInited[i] = false;
  The i variable is guaranteed to index 1 item past then end of this
  array since it only contains MAX_DEVICE_CONNECTED elements.  I have
  removed the line which sets deviceInited[i] to false.  Two questions
  result though:
    1) What was the intent of this line of code and is it Ok that I
       just removed it or should it be replaced with something else?
    2) I see no where else that elements in the deviceInited array are
       set to false except when all are set to false in the usbThread()
       method.  Should there be code in DEVICE_DISCONNECTED_EVENT to
       do this as well?
* USBHost::transferCompleted(volatile uint32_t addr) was comparing addr
  to NULL, which is of pointer type.  GCC issues a warning on this
  since the types are different (void* being compared to uint32_t).  I
  switched it to just compare with 0 instead.
* There is a switch statement in USBHost::unqueueEndpoint() which
  is conditional on a ENDPOINT_TYPE enumeration but doesn't contain
  cases for all values in the enumeration.  I just added a default
  case to simply break on other values to silence this GCC warning and
  allow the code to continue working as it did before.  Is it Ok that
  this particular piece of code only handles these two particular
  cases?
* USBHost::fillControlBuf() was generating a warning about possible
  alignment issues when accessing the setupPacket byte array as 16-bit
  half words instead.  I changed the casting to silence the warnings
  and modified the declaration of the setupPacket field to make sure
  that it is at least 2-byte aligned for these 16-bit accesses.
2013-08-29 19:22:36 -07:00
Adam Green bfafd8a014 USBHost: Calling memcpy() instead of memset()?
The two following memcpy() calls in USBEndpoint::init() are passing in
a NULL pointer as the copy source location.

    memcpy(td_list_[0], 0, sizeof(HCTD));
    memcpy(td_list_[1], 0, sizeof(HCTD));

I suspect that these were meant to be memset() calls instead so I
switched them.  In one of the places that I found where this method is
called, USBHost::newEndpoint(), its passes in an array of HCTD objects
which have already been cleared with similar memset() calls.  I am
therefore pretty certain that these were meant to be memset() calls but
if all callers already guarantee that they are zeroed out then maybe
the memset()s can be removed from USBEndpoint::init() anyway.
2013-08-29 18:22:22 -07:00
Adam Green 8a6d5ebc34 USBHost: Updates to allow compilation with GCC_ARM
I updated a few things in the USBHost source code to get it to compile
with GCC:
* In USBHALHost.cpp, the usb_buf global variable was defined with two
  different aligmnent specifiers:
    static volatile __align(256) uint8_t usb_buf[TOTAL_SIZE] __attribute((section("AHBSRAM1"),aligned));  //256 bytes aligned!
  The first one was not accepted by GCC.  I removed the duplicate
  alignment specifier and updated the one in the existing __attribute
  property to force the desired 256 byte alignment.
* Removed the explicit use of the __packed property from structures
  and instead used the PACKED macro defined in the mbed SDK's
  toolchain.h header file.  This macro does the right thing for the
  various compilers supported by the mbed team.
* Updated USB_* message macros in dbg.h to place spaces around
  references to the 'x' macro parameter.  Without this, C++ 11
  compilation thought the x character was a string literal operator but
  it wasn't one it recognized.  Adding the spaces makes it easier to
  see the use of the parameter, fixes this compile time error, and
  doesn't add any extra space to the final output string since the
  compiler only concatenates the contents within the double quotes of
  the strings.

By the way, I build with the gnu++11 standard since I have had requests
for its support from gcc4mbed.  Some of the items fixed here might not
be errors when using older standards with GCC.

I built and tested a USBHostMSD sample with these updates using both
GCC and the online compiler.  I will test more of the host interfaces
before issuing a pull request containing this commit.
2013-08-29 12:48:20 -07:00
Bogdan Marinescu e8bd53f85d Merge pull request #45 from dinau/master
Fixed: The issue of interrupt vector remapping for GCC_ARM LPC1114
2013-08-29 07:28:17 -07:00
dinau 841ce1d719 Fixed: The issue of interrupt vector remapping for GCC_ARM LPC1114 2013-08-29 21:40:57 +09:00
dinau 97d92789ec Fixed: The issue of interrupt vector remapping for GCC_ARM LPC1114 2013-08-28 23:29:16 +09:00
Adam Green b0c0f47c7d Changed leading whitespace back to tab.
The leading whitespace preceeding the fields in the lpc_enetdata
structure definition were originally a tab and I used 4 spaces when
I added RxThread.
2013-08-27 23:57:24 -07:00