Commit Graph

242 Commits

Author SHA1 Message Date
Jens Dede
7f80b1ad57 Remove include of stdio.h 2016-05-04 11:12:37 +02:00
Jens Dede
59afae85e2 Use if instead of ifdef. Is more contiki standard-compliant 2016-05-02 22:34:58 +02:00
Jens Dede
119291d083 Fix putchar include when using IPv4 2016-05-02 19:13:26 +02:00
Simon Duquennoy
20c97367a9 Adding definitions required for TSCH to the sky and z1 platforms 2015-12-04 15:21:53 +01:00
Nicolas Tsiftes
6def22b3c5 Merge pull request #1376 from sumanpanchal/wismote-uart1-dma
Wismote : Direct memory access using UART.
2015-11-26 11:08:43 +01:00
Tommy Sparber
938a425949 Cleanup trailing spaces and convert tabs to spaces
This commit removes trailing spaces and converts
tabs to spaces in all files affected by fix-doxygen PR.
2015-11-18 11:09:43 +11:00
suman_panchal
8d139222f6 Wismote : Direct memory access using UART. 2015-11-17 20:26:43 +05:30
Simon Duquennoy
fbd78a7e3b Merge pull request #1293 from simonduq/pr/fix-warnings
Fix a number of compiler warnings and enable -Werror in Travis
2015-11-10 08:49:11 +01:00
Antonio Lignan
6037e269a8 Merge pull request #1336 from sumanpanchal/z1-uart0-dma
Zolertia Z1: Direct memory access using UART.
2015-11-02 08:47:08 +01:00
suman_panchal
35cc40563e Zolertia Z1: Direct memory access using UART. 2015-10-31 11:45:13 +05:30
Simon Duquennoy
ca8fe618e7 cc2420 and cc2430: add comment on why we discard tbiv 2015-10-20 10:11:49 +02:00
Simon Duquennoy
01984f07c2 cc2420 and cc2430: removed compiler warning on unused tbiv 2015-10-20 09:37:16 +02:00
Simon Duquennoy
560d6af97b msp430x: do not compile mtarch, which currently assumes 16-bit function pointers 2015-10-20 09:37:15 +02:00
Antonio Lignan
37470bbc1b Merge pull request #1055 from sumanpanchal/msp430x-elfloader
Added MSP430x ELFLOADER support to load image with large memory model.
2015-08-27 21:19:27 +02:00
Sumankumar Panchal
db4df30366 Added MSP430X ELFLOADER support to load image with large memory model. 2015-06-15 17:53:18 +05:30
Antonio Lignan
e8b1a57ac6 Merge pull request #809 from cmorty/pull/msp430_gstabs
[MSP430] Add gstabs debug information (dwarf is broken)
2015-05-16 11:01:47 +02:00
George Oikonomou
c169b3e3bb Merge pull request #845 from alignan/fix_region
Changed code region to any
2015-03-10 22:04:38 +00:00
George Oikonomou
b6bd556805 Fix clock.h warnings caused by multiple, conflicting documentation blocks of clock functions 2015-02-15 21:48:30 +01:00
Simon Duquennoy
a9cc909794 Network layer configuration: replace UIP_CONF_* with NETSTACK_CONF_WITH_* 2014-12-01 21:02:57 +01:00
Simon Duquennoy
722b3258d1 Cleanup of the Contiki network layer configuration. Now using CONTIKI_WITH_IPV6, CONTIKI_WITH_IPV4, and CONTIKI_WITH_RIME in makefiles, and UIP_CONF_IPV6, UIP_CONF_IPV4, UIP_CONF_RIME in c code. Now only the stacks that are used are compiled (via makefile MODULES). Make IPv6 the default network stack. 2014-12-01 20:13:09 +01:00
Antonio Lignan
4cc070944f Changed code region to any 2014-11-03 22:40:51 +01:00
Moritz 'Morty' Strübe
e9ac379730 [MSP430] Add gstabs debug information (dwarf is broken)
Currently there is an linker error when compiling with debug information.
This is only the case for dwarf (the default). Everything is fine with
stabs, thus allowing to debug and use all the other nice tools like
"objdump -S".
2014-10-16 15:24:25 +02:00
Atis Elsts
5acf3fb770 Fix time accounting on msp430 Series 5 MCU based platforms (wismote)
See https://github.com/contiki-os/contiki/pull/727 for explanation
2014-08-21 18:09:54 +02:00
Atis Elsts
705587cdb7 Fix time accounting on msp430 Series 1 and Series 2 MCU based platforms.
The problem with the current version of the code was that the condition at the end of the do...while loop at Timer A1 interrupt:
 while((TACCR1 - TAR) > INTERVAL);
evaluates to false whenever TACCR1 == TAR.
Not incrementing TACCR1 in this case leads to Timer A1 interrupt not being called for 2 seconds, until TAR counter reaches TACCR1 again after an overflow.

The patch avoids this problem by changing the condition of the loop, and using CLOCK_LT macro to compare between time values.

The patch also attempts to fix another problem: a read of TAR register while it is being updated may return a lower value than the actual contents. To avoid that, the "read twice and compare results" idiom should be used. As the TAR register is updated by the actual hardware, it is of no importance whether it is read with interrupts disabled or enabled; the problem can occur in both contexts.
2014-07-02 11:07:02 +02:00
Antonio Lignan
3d64b80e40 Added flags to enable 20-bit support from msp430-gcc 4.7.x 2014-06-17 12:55:08 +02:00
Adam Dunkels
9ceb059c21 Merge pull request #611 from nfi/cc2x20-sfd-config
Corrected CC2x20 sfd config and startup message.
2014-06-11 23:17:05 +02:00
Adam Dunkels
def57199b9 Merge pull request #511 from ADVANSEE/leds
leds: Fixes and enhancements
2014-06-11 22:37:34 +02:00
Niclas Finne
2c953c3346 Support verbosity control when building MSP430-based platforms with
the IAR compiler.
2014-04-11 17:36:42 +02:00
Nicolas Tsiftes
1b49b68c3b Merge pull request #606 from atiselsts/master
Fix MCU clock calibration in msp430f2xxx based platforms (e.g. Zolertia Z1)
2014-04-09 21:52:08 +02:00
Niclas Finne
767a9aeef1 Use platform configuration for CC2420/CC2520 SFD on MSP430 based platforms 2014-03-28 11:54:10 +01:00
Niclas Finne
279b7fd040 Added rule to autocompile mspsim if needed and show warning if submodule MSPSim has not been initialized 2014-03-28 11:11:51 +01:00
Atis Elsts
68b65e6c47 Fix CPU clock calibration in msp430f2xxx based platforms (e.g. Zolertia Z1).
The following problems were present in the existing DCO calibration algorithm:

Problem #1. In function msp430_quick_synch_dco(), the "for(i=0; i < 1000; i++) { .. }" loop is optimized away by the compiler, as i is not volatile. Making i volatile would improve the results, but would not be sufficient: see the next point.

Problem #2. According to MSP430F2617 Device Erratasheet, bug BCL12 precludes a naive implementations of "fast" calibration altogether. The bug is present on all MCU revisions up to date.

The description of the bug:
"After switching RSELx bits (located in register BCSCTL1) from a value of >13 to a value of <12 OR from a value of <12 to a value of >13, the resulting clock delivered by the DCO can stop before the new clock frequency is applied. This dead time is approximately 20 us. In some instances, the DCO may completely stop, requiring a power cycle.

Furthermore, if all of the RSELx bits in the BSCTL1 register are set, modifying the DCOCTL register to change the DCOx or the MODx bits could also result in DCO dead time or DCO hang up."

In Contiki code for msp430f2xxx @ 8MHz, the RSEL search currently typically goes from 15 down to 11, thus violating the rules.

Step-by-step RSEL change is proposed as the best possible workaround:
"[..] more reliable method can be implemented by changing the RSEL bits step by step in order to guarantee safe function without any dead time of the DCO."

Problem #3. The old Contiki code started from the highest possible calibration values: RSEL=15, DCOx=7. According to MSP430F2617
datasheet, this means that the DCO frequency is set to 26 MHz. For one, Vcc under 3V is not supported for this frequency, so this means that battery-powered nodes have a big problem. The minimal operating voltages are:
- 1.8V for RSEL <= 13
- 2.2V for RSEL = 14
- 3.0V for RSEL = 15
So the correct way is to always start calibration from RSEL <= 13, unless explicityly pre-calibred values are present.

Problem #4. Timer B should be turned off after the calibration, following the "Principles for Low-Power Applications" in MSP430 user's Guide.

The patch fixes these issues by performing step-by-step calibration and turning off Timer B afterwards. As opposed to MSP430F1xxx calibration, this algorithm does not change the ACLK divider beforehand; attempts to make calibration more precise would lead to looping in some cases, as the calibration step granularity at larger frequencies is quite big.

Additionally, the patch improves DCOSYNCH_CONF_ENABLED behavior, allowing the resynchronization to correct for more than one step.
2014-03-25 11:47:13 +01:00
Adam Dunkels
c9efe3c3c4 Moved the cc2520 driver into its own dev/cc2520 module 2014-01-26 23:20:31 +01:00
Adam Dunkels
0b805e4763 Moved the cc2420 driver into a separate dev/cc2420 module 2014-01-26 23:20:27 +01:00
Adam Dunkels
5f3fe7f7c7 Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
Benoît Thébaudeau
7f48057b9e leds: Fix the API
The leds API did not work in some cases. E.g. with the following sequence:
  leds_off(LEDS_ALL);
  leds_toggle(LEDS_GREEN);
  leds_off(LEDS_ALL);
the green LED was remaining on after the last call.

This was caused by the toggle feature made synonymous with the invert feature,
although it is unrelated. leds_toggle() is indeed supposed to toggle an LED,
while leds_invert() is supposed to change the active level of an LED. However,
all users of leds_invert() actually meant leds_toggle(), and the invert feature
does not make sense in this module because it is not handy due to successive
calls to leds_invert() changing the intended behavior, and hardware active
levels should be managed in leds_arch_set() (e.g. by XORing the passed value
with a hardware-specific constant before setting the output levels of the pins).

Consequently, this change:
 - removes the leds_invert() function,
 - makes leds_toggle() behave as expected relatively to leds_off() / leds_on(),
 - sanitizes the code in the leds module.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2014-01-07 13:02:41 +01:00
Adam Dunkels
bb2dcaa057 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
Peter A. Bigot
5fc0575e99 Makefile.include: support make clean all
Historically $(OBJECTDIR) was created when Makefile.include is read.  A
consequence is that combining "clean" with "all" (or any other build
target) results in an error because the clean removes the object
directory that is required to exist when building dependencies.
Creating $(OBJECTDIR) on-demand ensures it is present when needed.

Removed creation of $(OBJECTDIR) on initial read, and added an order-only
dependency forcing its creation all Makefile* rules where the target is
explicitly or implicitly in $(OBJECTDIR).
2013-06-20 17:45:41 -05:00
Antonio Lignan
2cf4e30b11 Baudrate now is configured taking into account the MCU frequency, instead of using fixed values for 8MHz freq 2013-01-29 12:23:23 +01:00
Mariano Alvira
4087c0785f remove -g
see http://comments.gmane.org/gmane.os.contiki.devel/13869
2012-10-29 10:34:28 -04:00
Adam Dunkels
944537fccf Removed all old RCS tags in the Contiki source tree. Those RCS tags are not used any more, as we are now using git to manage the Contiki source tree 2012-10-26 15:54:49 +02:00
Niclas Finne
f5c8cff5b2 Made MT stack size configurable 2012-10-23 00:52:52 +02:00
Niclas Finne
767e8bb551 Default value for _DATA20_HEAP_SIZE when using the IAR compiler on MSP430 platforms 2012-09-20 14:01:56 +02:00
Niclas Finne
4630945475 Made the stack and heap size configurable when using the IAR compiler on the MSP430 platforms 2012-09-19 22:49:19 +02:00
Niclas Finne
418a5772e6 Removed leds debug output 2012-06-07 10:35:22 +02:00
Niclas Finne
1b13b69814 Added support for mspgcc 4.6+ that no longer supports generic MCU identifiers such as msp430x1611 2012-04-10 16:05:10 +02:00
Niclas Finne
57a166c3db Corrected compiler flags for the IAR compiler 2012-04-10 15:27:44 +02:00
David Kopf
cac4e9a222 Add clock_delay_us and clock_set_seconds to clock.h. Modify clock_wait to use clock_time_t.
Remove the troublesome avr/dev/delay.* files.
Add PLATFORM_NAME and combine the confusing *_REVISION defines into a single PLATFORM_TYPE
2012-04-09 15:49:53 -04:00
simonduq
95ae5c5d51 avoid unnecessary symbols.c/h copying 2012-03-26 23:00:43 +02:00
Niclas Finne
ff7a977dc7 Improved support for the IAR compiler for the MSP430 platforms 2012-03-07 23:09:05 +01:00