mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 13:23:25 -07:00
mod hw version: (#631)
* create fpga version info at compile time (by additional functionality in fpgacompress) * remove hw version caching (prepare USB reconnect) * fix calculation of available compressed bytes in fpga_loader.c
This commit is contained in:
parent
5125e4263c
commit
472345daee
9 changed files with 249 additions and 131 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "cmd.h"
|
||||
#include "proxmark3.h"
|
||||
#include "apps.h"
|
||||
#include "fpga.h"
|
||||
#include "util.h"
|
||||
#include "printf.h"
|
||||
#include "string.h"
|
||||
|
@ -286,6 +287,7 @@ void ReadMem(int addr)
|
|||
extern struct version_information version_information;
|
||||
/* bootrom version information is pointed to from _bootphase1_version_pointer */
|
||||
extern char *_bootphase1_version_pointer, _flash_start, _flash_end, _bootrom_start, _bootrom_end, __data_src_start__;
|
||||
|
||||
void SendVersion(void)
|
||||
{
|
||||
char temp[USB_CMD_DATA_SIZE]; /* Limited data payload in USB packets */
|
||||
|
@ -306,10 +308,12 @@ void SendVersion(void)
|
|||
FormatVersionInformation(temp, sizeof(temp), "os: ", &version_information);
|
||||
strncat(VersionString, temp, sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
|
||||
FpgaGatherVersion(FPGA_BITSTREAM_LF, temp, sizeof(temp));
|
||||
strncat(VersionString, temp, sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
FpgaGatherVersion(FPGA_BITSTREAM_HF, temp, sizeof(temp));
|
||||
strncat(VersionString, temp, sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
for (int i = 0; i < fpga_bitstream_num; i++) {
|
||||
strncat(VersionString, fpga_version_information[i], sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
if (i < fpga_bitstream_num - 1) {
|
||||
strncat(VersionString, "\n", sizeof(VersionString) - strlen(VersionString) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Send Chip ID and used flash memory
|
||||
uint32_t text_and_rodata_section_size = (uint32_t)&__data_src_start__ - (uint32_t)&_flash_start;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue