aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/libboard
AgeCommit message (Collapse)AuthorFilesLines
2018-07-24I2C: return error after failed writeKévin Redon1-7/+7
The previous mechanism of retrying a failed write could become a infinite blocking loop (until watchdog tiemout). Also the array size is used to know how much data to write and verify instead of a constant. Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec
2018-07-24I2C: add wait time after write to let EEPROM writeKévin Redon1-0/+2
The Atmel AT24C02 defines a maximum tWR waiting time after a byte write of 5 ms before a next write. Enforcing this wait time also fixed the failed verification in qmod, where it was reading 0xffff instead of the written value. Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b
2018-07-11make adc2uv commonKévin Redon2-2/+2
when building the trace app for the simtrace board gcc was outputing the following error: libboard/common/source/boardver_adc.c:20:17: warning: 'adc2uv' defined but not used [-Wunused-function] static uint32_t adc2uv(uint16_t adc) adc2uv is used by qmod, and defined in two places: in boardver_adc.c and mode_cardemu.c. this change will have adc2uv only defined in boardver_adc.c and make available in the header to be used by mode_cardemu.c. Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55
2018-07-11LED: add need patternKévin Redon2-0/+13
new LED pattern: off for 200 ms and then on Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c
2018-07-11replace leading spaces with tabsKévin Redon4-381/+381
Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1
2018-07-11set linux end of lineKévin Redon3-850/+850
Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b
2018-07-11firmware: set license to GPLv2+Kévin Redon26-31/+375
Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407
2018-07-11DFU: use central DFU override checkKévin Redon1-20/+6
TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa
2018-07-07DFU: re-enable UART after testing forced bootloaderKévin Redon1-8/+20
The qmod does not have a separate force button as simtrace has. Instead it check is TX and RX of UART are shorted using PIO. If the pins are not set back to the UART peripheral, the TRACE/debug console output will not work anymore. Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466
2018-07-07UART: remove unused codeKévin Redon1-1/+0
PutChar already takes care of enabling the IRQ Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233
2018-07-07UART: make IRQ/ISR enabling simplerKévin Redon1-8/+4
Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b
2018-07-07DFU: disable configured console UART before starting main appKévin Redon3-0/+19
The DFU uses the UART peripheral (with IRQ/ISR) for the debug output console. Before starting the main application we should make sure this configuration is reset to avoid interference (particularly the IRQ/ISR). This is not too important though since the main application reconfigures the UART for console output. Other peripheral could also be disabled (e.g. all other PIO used by DFU), but most of them also get configured by the main application. Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b
2018-07-07DFU: set stack pointer before starting main appKévin Redon1-1/+5
The stack size is fixed. The linker script puts the stack section after the bss section. The initial stack pointer is not at the end of the RAM (as often seen). Thus the initial stack pointer address of the main application is different than the one from DFU. When starting the main application the stack pointer needs to be set to the new value. If this is not done the main application stack may overwrite the data in bss, even without exceeding the fixed stack size. Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b
2018-07-04fix LED switching on/offKing Kévin1-2/+2
In the SIMtrace and QMOD schematics the LEDs are connected to +3.3V. Thus to switch the LED on we need to set the pin low. Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c
2018-07-04console: drop data to be send when buffer is already fullKévin Redon1-10/+8
don't wait for space to be available in the buffer since since would prevent from processing non-console (e.g. debug) more important data Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28
2018-07-04USB: add central file to define USB IDs, classes, and endpointsKévin Redon4-15/+3
Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f
2018-07-04LED: add short LED pulse blinking patternKévin Redon2-9/+17
Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447
2018-07-04board: fix LED pin definitionKévin Redon1-2/+2
Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db
2018-07-04DFU: remove force bootloader button debug message since the console is ↵Kévin Redon1-1/+2
output message is not initialized yet Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a
2018-07-04SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the ↵Kévin Redon1-1/+1
sniffer ISO state Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5
2018-07-04SIMtrace: fix default SIM_RST pin state to allow phone controlled resetKévin Redon1-1/+3
Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654
2018-07-04SIMtrace: only enable main sniffing mode on SIMtrace boardKévin Redon1-2/+2
Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b
2018-07-04board: comment USART definitions and add corresponding IRQ numbersKévin Redon1-2/+11
Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2
2018-07-04simtrace: add dedicated power pins configuration for sniffingKévin Redon1-5/+5
Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39
2018-07-04sniff: use USART 0 instead of USART 1Kévin Redon1-6/+12
Use USART 0 connected to the SIM card side to sniff the communication. The card side can also measure ETU times. Do proper pin initialization. This code can already capture the ATR communication between phone and card. Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6
2018-07-04SIMtrace board: comment and fix pin definitionKévin Redon1-65/+89
Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd
2018-07-04enable (empty) sniffer support for SIMtrace boardKévin Redon1-2/+2
Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b
2018-06-29Use system include <foo.h> notation for libosmocore headersHarald Welte3-3/+3
the curent local copies of libosmocore headers + source is a temporary hack anyway. We should instead rely on a system-wide install of libosmocore cross-compiled for arm-none-eabi. But leave that as a second (later) step beyond this patch. Change-Id: Ia63fd842d45a2b404233b4326050e7eda0604cf0
2018-06-29console: use buffer and interrupts instead of busy loops for UART debug outputKévin Redon2-13/+52
2018-06-29DFU: only boot the application if it has a valid startKévin Redon1-3/+14
2018-06-29DFU: uncomment print message when DFU is forced using the buttonKévin Redon1-1/+1
2018-06-29USB: implement USB reset by setting the on-board pull-up on D+ lowKévin Redon1-5/+4
2018-06-29fix pointer casting warningKévin Redon1-1/+1
fixes following warning: libboard/common/source/board_cstartup_gnu.c:137:11: warning: assignment to 'void (*)(void)' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion] appReset = pSrc[1];
2018-05-21add copyright noticeKévin Redon1-0/+1
The original board startup script is provided by Atmel. It has been modified to handle application or DFU booting. The copyright notice has been updated to reflect this change.
2017-11-28simtrace: Boot into DFU when BOOTLOADER button is pressedHarald Welte2-0/+15
This recovers the old functionality of the SAM7 based OpenPCD firmware.
2017-11-28DFU: Move "Override DFU" (force DFU) code to board-specific sectionHarald Welte2-0/+37
Each board can define its own conditions on which the controller should boot into DFU mode rather than normal application mode. Let's move the "UART loopback jumper" to QMOD specific part. For SIMtrace we have an actual button and can use that in a future patch.
2017-11-28board_simtrace: Add minimal debug menu on debug USARTHarald Welte1-0/+20
2017-11-28Make build of CCID code succeed again on BOARD=simtraceHarald Welte1-1/+1
2017-11-28fix build of APP=cardem on BOARD=simtraceHarald Welte2-6/+23
2017-11-03[firmware] sim_switch + wwan_perst: Don't re-initializeHarald Welte2-0/+2
The logic to detect if the respective module is already initialized or not was broken. When performing initialization, we of course need to set initialized=1.
2017-11-03[firmware] wwan_perst: Print index when releasing WWAN_PERSTHarald Welte1-1/+4
2017-11-03[firmware] wwam_led: use 0/1 instead of 1/2Harald Welte1-6/+6
most (all) other code modules have already moved over to consistently using a 0-based index.
2017-11-03[firmware] card_pres: use modem number at start of lineHarald Welte1-1/+1
... like most other code modules, too
2017-11-03[firmware] card_pres: Use 0/1 index number instead of 1/2Harald Welte1-5/+5
We have moved most (all?) other code to work with slots 0/1 rather than 1/2.
2017-05-20set local slot LED according to remote/local state.Harald Welte2-0/+9
The LED is illuminated as long as the slot is in local (physical SIM card) mode.
2017-05-20uart_console: Re-start watchdog during busy-waiting for serial charsHarald Welte1-1/+3
2017-05-11dfu: make sure to not bloat the loader with main board init stuff.Harald Welte1-0/+7
2017-05-11perst/sim_switch: Log events using TRACE_INFOHarald Welte2-4/+13
2017-05-11consistently use 0-based counting of modems/slotsHarald Welte3-8/+8
2017-05-09Generalize SIM switching code and allow local/remote switching via USBHarald Welte4-32/+76