Commit graph

148 commits

Author SHA1 Message Date
Philippe Teuwen 3fce47d023 Add hw tia to trigger a new Timing Interval Acquisition 2019-10-15 15:02:34 +02:00
Philippe Teuwen 3560cf5466 bootrom: remove deprecated CMD_SETUP_WRITE 2019-10-05 19:10:40 +02:00
Philippe Teuwen 9370649861 bootrom: avoid pointer magic to please coverity 2019-10-05 19:10:40 +02:00
Philippe Teuwen 9cf2cd7ca9 remove leading/tailing "/" from installation RELPATHs 2019-09-05 23:20:46 +02:00
Philippe Teuwen 4fdb5a2f4b make install: half way 2019-08-30 21:55:13 +02:00
Philippe Teuwen b5f5b9276f make install skeleton 2019-08-30 21:44:40 +02:00
Philippe Teuwen 8987e956ac POSIX sh version of mkversion
Most targeted platforms have "sh" and don't need Perl as requirement.
Still Perl script is present as fallback.
2019-08-29 23:23:53 +02:00
Philippe Teuwen d19754567d summer restructuring:
* .h include only the strict minimum for their own parsing
  * this forces all files to include explicitment their needs and not count on far streched dependencies
  * this helps Makefile to rebuild only the minimum
  * according to this rule, most standalone .h are now gone
  * big app.h is gone
  * remove seldom __cplusplus, if c++ happens, everything will have to be done properly anyway
* all unrequired include were removed
* split common/ into common/ (client+arm) and common_arm/ (os+bootloader)
  * bring zlib to common/
  * bring stuff not really/not yet used in common back to armsrc/ or client/
  * bring liblua into client/
  * bring uart into client/
  * move some portions of code around (dbprint, protocols,...)
* rename unused files into *_disabled.[ch] to make it explicit
* rename soft Uarts between 14a, 14b and iclass, so a standalone could use several without clash
* remove PrintAndLogDevice
* move deprecated-hid-flasher from client to tools
* Makefiles
  * treat deps in armsrc/ as in client/
  * client: stop on warning (-Werror), same as for armsrc/

Tested on:

* all standalone modes
* Linux
2019-08-11 21:42:01 +02:00
Philippe Teuwen 1354aec556 typos 2019-08-06 13:51:10 +02:00
Philippe Teuwen daae890667 Bootrom & flasher changes:
* use macros for versions
* activate UNDERSTANDS_VERSION in bootrom
* fix missing break; bug in bootrom
* force flash_load to reject images > 256k if bootloader not up to date
* move logic from flasher to flash
2019-07-20 10:48:40 +02:00
slurdge 68aa9d631d Flasher support for versionning
Only bootrom with version > 1.0.0 will allow 512K writes
2019-07-20 10:47:24 +02:00
slurdge c056e56492 Add a version command to the bootloader (not activated yet) 2019-07-20 10:47:24 +02:00
Philippe Teuwen 8e6258936c make style 2019-07-19 13:18:35 +02:00
slurdge 7bf3255a6c Flasher support for 512K flash
A better way would be to cut the connecting function and flashing function and to move the whole mem computation to flash.c
Working flasher
2019-07-19 12:35:04 +02:00
Philippe Teuwen b0dbbd3683 make style 2019-07-13 00:38:30 +02:00
slurdge 4727ab96d7 Dynamic report of the chipID for flashing purposes 2019-07-10 21:11:20 +02:00
Philippe Teuwen a55e597e36 make style 2019-06-07 21:40:33 +02:00
Philippe Teuwen 732bc766f9 Reduce some var scopes 2019-06-07 18:41:39 +02:00
Philippe Teuwen 8c0cd4cfa2 Cleaner makefile execution, use 'make Q=' if you want to see full lines 2019-06-02 00:25:25 +02:00
Philippe Teuwen 51e4df533e New button behaviour in bootloader mode:
- Keep button pressed when powering to force entering bootloader
  - Once in bootloader more, you can release the button
- When in bootloader mode (no matter how you entered that mode)
  - One button press to quit bootloader mode and boot main image
2019-05-26 17:48:30 +02:00
Philippe Teuwen 27f7057961 Rename few USB -> PM3 to avoid misleading interpretations 2019-04-30 21:10:11 +02:00
Philippe Teuwen 7d2d23ce50 fix bootrom using new names (but still old packets) 2019-04-25 01:53:09 +02:00
Philippe Teuwen 482db05741 Rename few stuff for consistency 2019-04-18 12:49:51 +02:00
Philippe Teuwen 4e31c6110b Better Command structs 2019-04-18 00:12:52 +02:00
Philippe Teuwen be15ad7fec Viva la revolucion 2019-04-17 21:30:01 +02:00
iceman1001 ce5fcf1e2d simplify 2019-04-07 12:20:17 +02:00
iceman1001 ca9061bd32 changed byte_t -> uint8_t 2019-03-21 15:19:18 +01:00
Philippe Teuwen 2f12e57408 Makefiles: remove spurious spaces/tabs 2019-03-10 11:35:03 +01:00
Philippe Teuwen 961d929f4d changing {} style to match majority of previous style 2019-03-10 11:20:22 +01:00
Philippe Teuwen 0373696662 make style 2019-03-10 00:00:59 +01:00
Philippe Teuwen 248a861613 bootrom: fix mix of spaces & tabs 2019-03-09 10:42:03 +01:00
Philippe Teuwen 60f292b18e remove spurious spaces & tabs at end of lines 2019-03-09 08:59:13 +01:00
iceman1001 38853b111f FIX: adding directives to reduce size on systems like Gentoo Hardned (see https://github.com/iceman1001/proxmark3/issues/268) 2019-01-05 20:59:00 +01:00
Chris 24eaac8681 CHG: the thread comms refactoring from offical pm3 repo
chg: FPC com speed limited to 115200 when compiled with FPC
chg: USART remake (@drandreas)
2018-09-06 21:43:20 +02:00
iceman1001 4d8488e14b CHG: https://github.com/Proxmark/proxmark3/pull/631 from offical repo. (piwi)
CHG: textual adjustments
2018-07-28 14:25:12 +02:00
Chris 49735b62f1 syntax sugar 2018-07-04 12:20:08 +02:00
Chris 35b7989b1c chg: OR in values. 2018-07-02 18:54:12 +02:00
iceman1001 b0545ed555 chg: re-arranged 2017-10-20 14:49:36 +02:00
iceman1001 3b665be5fc chg: usb_cdc, it should be similar to official pm3. lets 2017-10-19 13:06:47 +02:00
iceman1001 1f0a1edfbe CHG: restored the wait in flash-mode. Its waiting for the device to "reboot"..
CHG: usb_Cdc,   :  usb specs say 100ms delay. Previous delay was much longer...
2017-10-17 23:09:32 +02:00
iceman1001 dc7473135c syntax cleaning 2017-10-17 22:05:52 +02:00
iceman1001 d46955e309 FIX: bootrom - flashmode should also not assume sizeof(usbcommand) 544 bytes 2017-10-17 21:14:36 +02:00
iceman1001 16028f7d33 CHG: appmain now calls cmd_recieve as it should
CHG: flasher -  removed unneeded parameter to function
CHG: flasher - increased limit to fpga-files that can be loaded
FIX: main client,  wrong windows define fixed.
CHG: device side - recieve usb command does not always get 544 bytes.  usb packages can be incomplete.
CHG: usb_cdc.c also got piwi's changes.
CHG: uart_posix.c removed a debug value
CHG: uart_win32.c clean up.
2017-10-17 20:58:17 +02:00
iceman1001 77103e71cf CHG: bootrom flashmode, the delay wait, is already inside usb_enable() function. 2017-10-13 10:40:26 +02:00
iceman1001 e886490a2d CHG: from normal poll, to the length validating one. 2017-10-10 14:04:20 +02:00
iceman1001 07fffb4645 CHG: bootrom configuration to highest clock PLL 2017-09-26 17:04:53 +02:00
iceman1001 0f7241f4b3 FIX: found old thread on forum from 2010, saying this bitshifts are wrong.
ref:   http://www.proxmark.org/forum/viewtopic.php?id=643
2017-09-26 00:19:54 +02:00
iceman1001 1c3ffe1ce2 syntax sugar 2017-09-20 10:42:03 +02:00
iceman1001 6598e12752 FIX: good solution for enabling 512kb memory, instead of a #define. It reads the chipId and detects memsize based on it. 2017-08-22 11:55:00 +02:00
iceman1001 4406f4ee2a CHG: removed some #DEFINE TRUE/FALSE 2017-07-07 12:52:51 +02:00
iceman1001 07bc72b880 CHG: continue code cleanup.
REM: removed stdint.h ,  since we are using c99 when compiling.
2017-02-23 00:32:14 +01:00
iceman1001 9932c55a4a CHG: lf em - refactored @marshmellow42 's em paritycheck.
ADD: `bootrom/Makefile` got some options.  It shouldnt change anything.
2017-02-19 23:24:19 +01:00
iceman1001 5a08545794 ADD: added a compiling flag -DHAS_512_FLASH i common/Makefile.common, to be used for PM3 devices with 512KB. Original commit from @hewitt 2016-10-07 00:12:09 +02:00
iceman1001 3c6542087e CHG: @ikarus23 removed all missleadning warnings for GCC6.1.1. 2016-09-26 21:38:19 +02:00
René Werner 1cb9b2a3cf used tabs instead of spaces 2016-09-13 21:04:13 +02:00
René Werner 78f59945a7 fixed indentation to get rid of warnings
warnings are treated as errors, so a warning due to misleading
indentation is kinda annoying
2016-09-13 20:57:25 +02:00
iceman1001 cf69eca0ff CHG: a bit code clean up,
FIX: a comparison with signed vs unsigned was solved.   I'm reluctant to change this code since it is a vital piece.
2016-03-01 07:00:56 +01:00
iceman1001 0de8e3874d A lot of changes...
.. ntag simulation stuff from @marshmellows branch "ntag/sim"
.. hf mf mifare fixes from @pwpivi.
.. hw status command
.. speedtest function from @pwpivi
.. Viking Functionalities,   (not a proper DEMOD, but a start)
.. GetCountUS  better precision from @pwpivi
.. bin2hex,  hex2bin  from @holiman

...
starting with getting the T55x7 CONFIGURATION_BLOCK for different clone situations. Ripped from Adam Lauries RFidler,   nothing working or finished..
...
Started working with the T55x7 read command with password actually performs a write block...  See Issue #136  https://github.com/Proxmark/proxmark3/issues/136    Not solved yet.

...
Started add SHA256..   not working yet..
2015-10-04 18:01:33 +02:00
iceman1001 7838f4beba MERGED: @holimans changes
MERGED: @piwi changes
MERGED: @marshmellows changes.

I'm not even gonna try write up all that stuff..

ADD: changed some commands inside the "Hf 14a sim" on deviceside.
ADD: @mobeius "two nonce" version for mfkey32.   It is also inside the "hf 14a sim" with the "x" parameter.
2015-07-22 23:00:52 +02:00
iceman1001 225ccb910e ADD: new defines: iso14443_CMD_AUTH_KEYA, iso14443_CMD_AUTH_KEYB, iso14443_CMD_AUTH_RESPONSE, iso14443_CMD_AUTH_STEP1, iso14443_CMD_AUTH_STEP2, CHINESE_BACKDOOR_INIT, CHINESE_BACKDOOR_STEP2,
REM: removed old comments in bootrom.c
CHG: mifare ultralight & desfire commands inside arm has been cleaned up. Next step is to refactor it into armsrc/mifaredesfire.c
2015-01-07 17:42:57 +01:00
roel@libnfc.org 349eabe567 updated code to follow same blinking patterns with leds during flashing/holding button 2013-03-02 06:28:28 +00:00
roel@libnfc.org 28fdb04fd8 Finally, rewrote bootrom and flasher program, much faster now 2013-02-28 15:11:52 +00:00
roel@libnfc.org 6e82300dda removed all old usb calls 2012-12-05 16:14:10 +00:00
roel@libnfc.org 902cb3c00b major USB update 2012-12-04 23:39:18 +00:00
henryk@ploetzli.ch 2c3685c26c BOOTROM CHANGE: Add jump to interrupt handler from Advanced Interrupt Controller.
This change is necessary for all IRQ functionality. If a future osimage needs IRQ functions, the bootloader must be updated to at least this version.
2010-09-10 22:34:24 +00:00
adam@algroup.co.uk bd84638614 create target for binary file archive (linux version) 2010-05-09 12:17:42 +00:00
d18c7db 0aa4cfc2f1 Fix up small error in main osc startup delay and replace more custom defines with standard Atmel defines 2010-03-04 08:15:59 +00:00
marcansoft 24b182d01b Remove 512k support, fix flash waitstates
512k chip support isn't complete anyway and the incorrect clock would've
ended up destroying Flash anyway. The 256k waitstates were set to 0,
which is outside the spec. Set them to 1, which is allowed.
2010-03-03 13:33:24 +00:00
d18c7db 86c35934fc Corrected erroneous bit masking 2010-02-28 05:30:26 +00:00
marcansoft 9af4835863 Add KEEP() to version information section
Prevents it from being garbage collected
2010-02-26 23:29:22 +00:00
marcansoft 7f7e715756 Add explicit PHDRs to bootrom to properly separate data and bss 2010-02-26 21:40:27 +00:00
marcansoft 86d3195518 Bootloader cleanup (UNTESTED!)
- Clean up bootloader asm
- Remove fromflash.c - it's not worth doing in C, do it in ASM
- Clean up linker script
- Force use of symbol inside bootphase2 (otherwise linker
  garbage-collects it)
- Link bootloader with gcc instead of ld
2010-02-26 15:14:47 +00:00
marcansoft c1bd1140c4 Some random cleanup 2010-02-21 00:13:08 +00:00
marcansoft bd20f8f478 Add license headers to armsrc/bootrom/common stuff
I have kept whatever copyright notices exist. Please add your own
copyright notice if you have made any nontrivial changes or additions to
the code. There are several files without any attribution, currently.
2010-02-21 00:12:52 +00:00
marcansoft f7e3ed8287 Clean up data types, some header cleanup, etc. 2010-02-20 22:51:00 +00:00
marcansoft e30c654b19 More en masse cleanup (whitespace/newlines/headers/etc) 2010-02-20 21:57:20 +00:00
marcansoft 15c4dc5ace Clean up line endings, switch everything to LF instead of CRLF
Doing this for bootrom and armsrc for now. If you're using Windows,
please configure your editor for LF line endings.
2010-02-20 21:24:25 +00:00
marcansoft 72c4af087f Add obj/.dummy for clients that don't track empty dirs 2010-02-20 21:20:47 +00:00
izsh@fail0verflow.com 5e174a511b marcan's patch until he gets commit access. Remove C library's includes from the firmware side since it's not available anyway and not used 2010-02-20 03:07:55 +00:00
henryk@ploetzli.ch 4fdefea801 Automatically enter bootrom when OS image doesn't appear to be proper 2010-01-16 06:10:04 +00:00
henryk@ploetzli.ch 4ab6281664 Make the bootrom correctly nack in case of flash write error (e.g. due to lock bits) 2010-01-01 14:56:25 +00:00
bushing 1dea88f976 fix some ARM build fail 2009-12-22 12:48:33 +00:00
d18c7db 6949aca9fa Pushed standard AT91 defines into main code 2009-09-29 12:13:41 +00:00
d18c7db 57fcd2d7d1 added eh_frame needed for gcc 4.4.1 or higher 2009-09-07 09:53:45 +00:00
henryk@ploetzli.ch 8fcbf652da New bootrom
+ Add common area at end of RAM to communicate between main os and bootrom
+ Lower stack end to make room for common area
+ Implement CMD_DEVICE_INFO in both OS and bootrom to give information about the current state and supported features
+ Allow hands-free firmware update: When CMD_START_FLASH is received over USB in OS mode, the device will reset and enter the bootrom
  Pressing the button in hands-free update mode takes precedence: releasing the button will immediately abort firmware update and 
  perform a reset. Do not press the button.
+ Require each flash sequence to be preceded by a CMD_START_FLASH to set up the boundaries for the following flash sequence
  Not compatible with linux flasher before SVN revision 200
  Currently no compatible flasher for Windows. WINDOWS USERS: DO NOT UPDATE YOUR BOOTROM YET
+ Protect bootrom flash area unless magic unlock sequence is given in CMD_START_FLASH
2009-09-01 14:44:38 +00:00
henryk@ploetzli.ch e3ae025783 Eradicate all occurences of hardcoded memory addresses from all sources files, except for the FPGA bitstream fallback 2009-08-31 14:52:59 +00:00
henryk@ploetzli.ch 4271e82d56 Only re-compile version.c as often as necessary
Make bootrom version information pointer a proper symbol (with hacky ld strangeness workaround)
2009-08-29 06:14:28 +00:00
henryk@ploetzli.ch 8a6aec16d8 Implement version information storage and retrieval for the bootrom and the osimage.
Use perl to create the version information (thereby re-creating the perl dependency and adding an svn dependency) but fall back in case of missing perl or svn
2009-08-28 06:40:44 +00:00
henryk@ploetzli.ch 7af790aa03 Jump to the correct physical address in Flash. (The comment was wrong, it never used RAM) 2009-08-28 00:36:02 +00:00
henryk@ploetzli.ch e73e717239 Add Makefile for fpga directory (Windows codepath is untested, in any case, go.bat is still there)
Retire rbt2c.pl, instead use objcopy to directly convert the .bit file into an .o that can be linked with the flash image
Rename armsrc/fpga.c to armsrc/fpgaloader.c (since there is now a new fpga.o, created from fpga.bit)
Remove fpgaimg.c from subversion, add fpga.bit
Instead of creating fpgaimage.elf and osimage.elf separately, now create a joined fullimage.elf 
  first (obsoleting ldscript-full), then extract only the fpga and os sections with objcopy
  (This creates unspecific warnings about an empty segment, need to investigate)
Implement a rudimentary .bit parser in the firmware, use that to locate the bitstream in the new
  fpgaimage (which is just a plain copy of the fpga.bit file) and send it to the FPGA
  The code will check the format that's in flash and fall back to the legacy format
2009-08-27 23:29:49 +00:00
henryk@ploetzli.ch 2bfed17db2 Add a common linker script with the memory map for the complete project
Use the correct physical addresses in the memory map, and instead translate the addresses during postprocessing with objcopy
2009-08-27 16:07:35 +00:00
henryk@ploetzli.ch fb6e5aa863 The older gnuarm in the windows toolchain seems to need the glue_7t section 2009-08-27 04:46:31 +00:00
henryk@ploetzli.ch 8652988d62 Merge linker scripts in bootrom to have a single linker script for the bootloader proper (previously known as bootrom-merged.s19)
Remove the now unnecessary files (merge-srec.pl, ldscript-ram-jtag)
Note that this drops the dependency on perl for bootrom build, so end-users who don't touch the FPGA bitstream will not need perl anymore
2009-08-27 04:25:34 +00:00
henryk@ploetzli.ch 0fc0fca583 Move most rules to Makefile.common
Add automatic dependency generation
Compile ISO14443 files in ARM mode, as was the case with the Linux Makefile before
2009-08-26 17:34:19 +00:00
henryk@ploetzli.ch 7e931bbd32 Consolidate Linux/Windows Makefiles into one, see http://www.proxmark.org/forum/topic/312/consolidating-makefile/
+ Needs GNU make for Windows, a new release of the Windows development environment will follow
 + Is based on the Windows Makefile, so will build everything in Thumb mode, doesn't have flash commands (yet)
2009-08-26 11:17:05 +00:00
d18c7db 0422e2a471 Reduced the size of BigBuf to make more room for stack/vars 2009-07-29 13:37:09 +00:00
edouard@lafargue.name aa4d9d9b73 - Added new Makefile.linux in bootrom directory
- Cleaned up Makefile.linux in armsrc directory
- Added Linux toolchain build script in tools directory
- Made LCD support optional (disabled by default) in armsrc
- Small formatting changes
2009-04-25 21:19:59 +00:00
edouard@lafargue.name 6658905f18 Initial commit for the firmware. Used the 20090306_ela version as baseline.
It is identical to the popular 20081211, with the doob addition (20090301), a
linux client, and two additional commands for LF analysis. Let me know if
you find issues here!
2009-04-09 06:43:20 +00:00