Commit Graph

657 Commits

Author SHA1 Message Date
Harald Welte cb6e20596e contrib/jenkins.sh: Also run firmware tests + build-test host software
Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b
2018-07-01 16:33:25 +02:00
Harald Welte bb2eb19fb1 firmware/test: Add more include paths
Change-Id: I4287fbae6921ed0605265812df5d7243e8857864
2018-07-01 08:47:39 +02:00
Harald Welte 9d90d284ed Use system include <foo.h> notation for libosmocore headers
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-29 22:26:57 +02:00
Harald Welte ebe8b2069c Makefile: fix automatic creation of obj directory
since we're using obj/$BOARD, we must use "-p" to create the directory
recursively
2018-06-29 21:44:12 +02:00
Harald Welte 105c1dce4f add contrib/jenkins.sh for build verification
The contrib/jenkins.sh script will build all supported apps for all
supported builds.  It will be used by jenkins/gerrit build testing.
2018-06-29 21:39:42 +02:00
Harald Welte 1cfc2614dd apps/dfu/main.c: Avoid variable declaration in for loop initial
This fixes the following compile error:

apps/dfu/main.c:73:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (unsigned int i=0; i<len; i++) {
   ^
apps/dfu/main.c:73:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

which was recently introduced in b73f0a00bc
2018-06-29 21:07:41 +02:00
Kevin Redon a9bca48914 ring buffer: increase buffer size from 128 to 256 to cope with large debug output 2018-06-29 20:07:31 +02:00
Kevin Redon eac1bec428 console: use buffer and interrupts instead of busy loops for UART debug output 2018-06-29 20:07:31 +02:00
Kevin Redon 51c128bc35 DFU: fix typo in USB strings 2018-06-29 20:07:31 +02:00
Kevin Redon 869dbfafe4 DFU: incread watchdog timeout and restart watchdog before writing in flash to prevent the watchdog to trigger while flashing 2018-06-29 20:07:31 +02:00
Kevin Redon 80303c135b DFU: only boot the application if it has a valid start 2018-06-29 20:07:31 +02:00
Kevin Redon d86cab0080 DFU: uncomment print message when DFU is forced using the button 2018-06-29 20:07:31 +02:00
Kevin Redon b73f0a00bc DFU: unlock the flash before writing, verify written data, and relock it 2018-06-29 20:07:31 +02:00
Kevin Redon f5869d4a59 USB: implement USB reset by setting the on-board pull-up on D+ low 2018-06-29 20:07:31 +02:00
Kevin Redon 4136c242a8 USBD: send empty packet when non-existing descriptor string is requested
Sometimes descriptor string 0xee is requested.
This is a mechanism used by Microsoft Windows to further identify the USB device.
Instead of stalling, as is the original code, leading to an USB reset, we send an empty packet.
I am not sure if sending an empty string would be better, but an empty packet seems sufficient.
2018-06-29 20:07:31 +02:00
Kevin Redon 318309f30f dfu: fix address destination check and add stack overwrite check in USBDFU_handle_dnload
During DFU download the destination start address is checked to not exceed the
RAM or flash end address, but it is also necessary to check if the end of the
data to be downloaded is also within the allowed range.
When downloading to RAM it is also necessary to check if the data to be
downloaded does not overwrite (i.e. corrupt) the stack.
2018-06-29 20:07:31 +02:00
Kevin Redon 0828b914e7 README: rewrite to better explain environment variables and point to the wiki for flashing 2018-06-29 20:07:31 +02:00
Kevin Redon 76be7c806e fix pointer casting warning
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-06-29 20:07:31 +02:00
Kevin Redon a38a126361 fix: initialize uninitialized variable in USBDFU_DFU_RequestHandler 2018-06-29 20:07:31 +02:00
Kevin Redon 6822716428 add printf attribute declaration to remove warning
the __attribute__ ((format (printf, 1, 0))) declaration remove the following
compilation warning:
warning: function 'osmo_panic' might be a candidate for 'gnu_printf' format
 attribute [-Wsuggest-attribute=format]
   osmo_panic_default(fmt, args);
2018-05-21 17:18:58 +02:00
Kevin Redon a93f7273b3 fix: remove duplicate volatile declaration 2018-05-21 17:17:20 +02:00
Kevin Redon 432ba5140e add copyright notice
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.
2018-05-21 17:13:50 +02:00
Harald Welte 849d20e29e Add firmware/TODO.txt that was not committed so far 2018-05-11 15:49:31 +02:00
Harald Welte e48d6f2321 Add README.md 2018-05-11 15:48:54 +02:00
Harald Welte af616ec4e2 CCID driver: Use USBD_GetDriver() instead of non-initialized state variable 2017-11-29 00:45:23 +01:00
Harald Welte 6051e126da CCID: re-enable control request handler for CCID class requests 2017-11-29 00:26:34 +01:00
Harald Welte 7f62c24532 USB: Handle DFU requests by USBD.c to keep application callback
e.g. in CCID mode we need to treat class-specific control requests,
and we want to do this in a way how the CCID code doesn't need to
understand about DFU.
2017-11-29 00:24:28 +01:00
Harald Welte 75cf93e04d rename ccid.c to mode_ccid.c to align with mode_cardemu.c 2017-11-28 23:00:40 +01:00
Harald Welte 2afd57f00a cardem: Don't dispatch UART IRQs to possible NULL pointers
A given configuration might not expose callback functions for
the UART interrupts.
2017-11-28 22:52:56 +01:00
Harald Welte 0633b25974 iso7816_4: Re-trigger watchdog while waiting for character 2017-11-28 22:47:09 +01:00
Harald Welte c1e2254854 simtrace: Boot into DFU when BOOTLOADER button is pressed
This recovers the old functionality of the SAM7 based OpenPCD firmware.
2017-11-28 22:29:53 +01:00
Harald Welte 27f5fc681c DFU: Move "Override DFU" (force DFU) code to board-specific section
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-28 22:15:56 +01:00
Harald Welte 7b250bfc8d board_simtrace: Add minimal debug menu on debug USART 2017-11-28 22:10:49 +01:00
Harald Welte ed75c62acf {ccid,sniffer}.c: Add comments on USB callbacks 2017-11-28 21:23:12 +01:00
Harald Welte 5c081911a9 remove dead code (source/phone.c), superseded by card_emu.c/mode_cardemu.c 2017-11-28 21:21:50 +01:00
Harald Welte 5e6e8dcbde Make build of CCID code succeed again on BOARD=simtrace 2017-11-28 20:58:06 +01:00
Harald Welte c35998e20d Makefile: Disable -Wundef and -Wsign-compare for now
This silences tons of warnings which are making it hard to identify
actual issues when looking at the compiler output.
2017-11-28 20:47:23 +01:00
Harald Welte ba2ad563cc fix build of APP=cardem on BOARD=simtrace 2017-11-28 19:49:41 +01:00
Harald Welte fc87c24326 mode_cardem: Build on platforms without WWAN_PERST suppotrt 2017-11-28 19:17:27 +01:00
Harald Welte f231541601 Fix typos in usb.c, llist_irqsafe.h and dfu.h 2017-11-28 19:16:57 +01:00
Harald Welte 119624f46f WIP: use local_irq_{save,restore}() 2017-11-04 12:28:30 +01:00
Harald Welte 7b36306113 [firmware] WIP: make talloc irq-safe 2017-11-04 12:17:09 +01:00
Harald Welte eb50c9f914 [firmware] sim_switch + wwan_perst: Don't re-initialize
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 20:52:35 +01:00
Harald Welte 965d5c918a [firmware] cardemu: Skip CARD_INSERT if board doesn't support it 2017-11-03 20:48:11 +01:00
Harald Welte 514c6d1da0 [firmware] wwan_perst: Print index when releasing WWAN_PERST 2017-11-03 20:40:56 +01:00
Harald Welte e7f2f9a5e0 [firmware] wwam_led: use 0/1 instead of 1/2
most (all) other code modules have already moved over to
consistently using a 0-based index.
2017-11-03 20:38:31 +01:00
Harald Welte 4e837d45db [firmware] card_pres: use modem number at start of line
... like most other code modules, too
2017-11-03 20:36:17 +01:00
Harald Welte b52b886186 [firmware] card_pres: Use 0/1 index number instead of 1/2
We have moved most (all?) other code to work with slots 0/1
rather than 1/2.
2017-11-03 20:33:10 +01:00
Harald Welte c47fc5febf set local slot LED according to remote/local state.
The LED is illuminated as long as the slot is in local (physical SIM
card) mode.
2017-05-20 14:46:57 +01:00
Harald Welte 02d0ec6e08 uart_console: Re-start watchdog during busy-waiting for serial chars 2017-05-20 14:46:57 +01:00