Commit Graph

5680 Commits

Author SHA1 Message Date
Dimitry Kloper
3746305f12 AVR: Minor adapt to a differnt TIMER IRQ notions for Atmega2560 2015-12-29 19:08:13 +02:00
Dimitry Kloper
556954141e AVR: Add support for AVR chips with 24-bit Program Counter register
The main challenge is to change the context switch code to be aware of the
extra byte that is saved on stack during call and intterupt. This relates also
to the task startup and signal handling.
2015-12-29 19:01:06 +02:00
Dimitry Kloper
99aab135b2 AVR: Make setting of XDIV optional for platforms that support it
Put setting of XDIV into ifdef since not AVR platforms support it.
2015-12-29 18:56:12 +02:00
Dimitry Kloper
462307f4b7 AVR: Clear EIND on system start-up
For AVR chips (Atmega2560) Program Counter register larger than 16 bits
EIND represents the most significant byte that is used for EICALL and EIJMP
instructions.

Setting of EIND is normally managed by compiler, but I have seen a situation
when for first 64K flash segment compiler didn't set EINT explicitly. Thus
setting EIND at system startup makes sure we are safe.
2015-12-29 18:46:28 +02:00
Dimitry Kloper
9a4a06bf47 AVR: Explicitly disable interrupts as the first step of system init
Disabling interrupts at the very beginning of system init does not
make sense after reset since interrupts are disabled anyway. But
it is very convenient for debugging purposes, in situations when the
system misbehaves and ocassionally jumps to zero.
2015-12-29 18:35:36 +02:00
Dimitry Kloper
ff5e589f76 AVR: add support for TCGETS and TCSETS terminal controls
Sometimes I need UART to support binary data transfer, TCSETS/TCGETS allow
stwitching into binary mode.
2015-12-29 17:56:44 +02:00
Dimitry Kloper
d6f6e41a36 AVR: Fix linking error for AVR platforms that have no ARCH_HAVE_LEDS defined
Minor bug while working on Arduino Mega support. I didn't add support
for ARCH_HAVE_LEDS and have it undefined in .config. To my surprise compilation
failed since AVR code had a related function compiled in.
2015-12-29 17:26:11 +02:00
Dimitry Kloper
8f8b88f532 AVR: Fix resulting nuttx file name when EXEEXT is not empty
arch/avr/Makefile is adding extra EXEEXT to the
nuttix image file. This was not discovered since in most configurations
EXEEXT is empty string.
2015-12-29 17:19:30 +02:00
Dimitry Kloper
41bdcd16b8 Change notation of PCH and PCL registers into PC0 and PC1
This is for forthcoming Atmega2560 support. The Atmega2560 has 24-bit PC
thus, PCH and PCL would become PCH, PCM and PCL (M for Middle). The problem
that in this notation PCM is equivalent to former PCH. This makes compatable
porting kind of difficult, at least for my taste.

Instead PCH becomes PC0 and PCL becomes PC1 (think of the index as order of
bytes pushed to stack when call is performed, PC0 as MSB goes first, PC1
goes to stack second, and for 24-bit PC, PC2 as LDB goes last).
2015-12-28 00:46:24 +02:00
Dimitry Kloper
0c1294d332 Introduce a new Kconfig variant for Atmega2560 and add some basic stuff
Modify Kconfig to be aware of the new chip.
Add all the interrupt hanler constants and vectors where needed.
Move contsatnts from generic to specific headers when needed.
2015-12-27 01:47:35 +02:00
Dimitry Kloper
0998876ef6 AVR: Fix interrupt bombing during a context switch
TCB_RESTORE macro has a problem when restoring Status Register
and returning from the function (in up_fullcontextrestore()) as non-atomic action.

If there is some frequently occurring interrupt, chances are that we will
enter the interrupt handler just before ret is called.
The handler may cause a context switch which, when unrolled, will
execute up_fullcontextrestore() function that employs TCB_RESTORE.
It will be interrupted again just before return, leaving part of context
switch content un-popped again, etc... Thus, chances are that the stack will
eventually blow.

Note that this is not some edge condition fix. This bug was discovered when
testing AVR with UART configured to work on 115200 baud rate.
2015-12-26 21:55:40 +02:00
Gregory Nutt
6b1f3da01a TMS570: Don't try building arm_fpuconfig.S for a Cortex-R4 2015-12-24 13:46:49 -06:00
Gregory Nutt
ea1fa2e938 TMS570: SCI serial driver is now included in the build and compiles without error 2015-12-24 13:37:42 -06:00
Gregory Nutt
90cfe8e23b TMS570: Initalize SCI interrupt handling logic 2015-12-24 12:35:22 -06:00
Gregory Nutt
af1504ec4a TMS570: Flesh out low-level serial console logic 2015-12-24 11:07:03 -06:00
Gregory Nutt
ba0f5467d0 A few more cosmetic changes 2015-12-24 07:38:17 -06:00
Gregory Nutt
376b35be39 Mostly cosmetic changes from review for conformance to coding standard 2015-12-24 07:35:19 -06:00
Gregory Nutt
f5340f0e2e Merged in pnb990/nuttx-kernel-arch (pull request #44)
Master
2015-12-24 07:14:14 -06:00
pnb
400d06e9ec fix capture bug 2015-12-24 12:26:39 +01:00
pnb
709c257a43 cosmetic 2015-12-24 09:45:02 +01:00
pnb
097b5820a1 Merge branch 'master' of bitbucket.org:pnb990/nuttx-kernel-arch 2015-12-24 09:42:48 +01:00
pnb
e22d8aea5d add oter timer 2015-12-24 09:42:33 +01:00
pnb
5f9d23290a Merge remote-tracking branch 'upstream/master' 2015-12-24 09:21:40 +01:00
Gregory Nutt
7c72f32bbc TMS570: Add TMS570 SCI driver(s). Initial commits are just SAMV7 drivers with name changes. A lot more needs to be done 2015-12-23 17:48:33 -06:00
Gregory Nutt
1ab3e02ac8 TMS570: Fix a few naming issues leftover from leverage 2015-12-23 16:08:29 -06:00
Gregory Nutt
a76f2b853a TMS570: Add system timer logic 2015-12-23 13:41:36 -06:00
pnb
cfe9555e24 capture start to works need test it more 2015-12-23 19:07:45 +01:00
Gregory Nutt
fa36531fee TMS570: Add default VIM channel assignments 2015-12-23 09:45:32 -06:00
Gregory Nutt
6db67471cb TMS570: Add an RTI header file. Still incomplete on initial commit 2015-12-23 08:18:18 -06:00
Gregory Nutt
663d2b0127 Eliminate a warning due to a range check on an undefined pre-processar variable 2015-12-22 13:20:20 -06:00
pnb
54b275ec09 Merge branch 'master' of bitbucket.org:pnb990/nuttx-kernel-arch 2015-12-22 16:32:19 +01:00
pnb
9cc2119c4e capture compile 2015-12-22 16:28:19 +01:00
pnb
badc0c2215 Merge remote-tracking branch 'upstream/master' 2015-12-22 13:29:31 +01:00
pnb
0ef3dc81aa Merge branch 'master' of bitbucket.org:pnb990/nuttx-kernel-arch 2015-12-22 13:28:39 +01:00
pnb
7d244d4d04 Revert "add timer capture STM32"
This reverts commit 7a484f4d7665c533998d6893c21b69340038b5fc.
2015-12-22 13:27:42 +01:00
pnb
764c9ea887 Revert "used DEFINE instead of setcapturecfg function to set filter and prescaler of input capture"
This reverts commit 08600d05eb12cb4f62280766b7f780e8eaa2284b.
2015-12-22 13:27:35 +01:00
pnb
573462e355 Revert "continue capture integration"
This reverts commit c0b6ba73d59dc973d6984bce12ff4a20d870de2a.
2015-12-22 13:27:00 +01:00
pnb
406bc5e67e continue capture 2015-12-22 13:26:22 +01:00
Gregory Nutt
3e4fb7a60d Merged in paulpatience/nuttx-arch/stm32_adc (pull request #42)
STM32 ADC: Add DMA support for STM32F30xxx
2015-12-22 05:45:10 -06:00
pnb
f88e62c8e9 continue capture 2015-12-22 12:21:03 +01:00
Paul A. Patience
754a4ddb98 STM32 ADC: Add DMA support for STM32F30xxx 2015-12-22 03:42:37 -05:00
Gregory Nutt
d7af5b234c Fix an error in pre-processor condition 2015-12-21 21:36:34 -06:00
Gregory Nutt
860a2fc786 TMS570: Add interrupt decode logic 2015-12-21 12:17:26 -06:00
Gregory Nutt
092c681157 TMS570: Add a little more IRQ/FIQ logic 2015-12-21 10:57:01 -06:00
Gregory Nutt
caad954b01 TMS570: Add VIM header file 2015-12-21 07:40:27 -06:00
Gregory Nutt
010a73d3b6 TMS570: A little more selftest structure 2015-12-20 17:55:21 -06:00
Gregory Nutt
a2fb50d812 TMS570: Add a framework that will eventually support self-test 2015-12-20 11:51:36 -06:00
Gregory Nutt
2629053bbe TMS570: Add pin multiplexing logic 2015-12-20 10:14:51 -06:00
pnb
510dc7872d Merge remote-tracking branch 'upstream/master' 2015-12-20 13:00:17 +01:00
pnb
2f78c0c1bc continue capture integration 2015-12-20 12:54:21 +01:00