Skip to content

add --format json output enhacement to flash and certificates commands #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 16, 2021

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Jun 15, 2021

flash and certificates commands output now can be set to json 🥳
By running FirmwareUploader firmware flash -b arduino:samd:mkr1000 -a /dev/ttyACM0 --format json something like this is returned:

{
  "programmer": {
    "stdout": "Set binary mode\nreadWord(addr=0)=0x20007ffc\nreadWord(addr=0xe000ed00)=0x410cc601\nreadWord(addr=0x41002018)=0x10010305\nversion()=v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43\nchipId=0x10010005\nConnected at 921600 baud\nreadWord(addr=0)=0x20007ffc\nreadWord(addr=0xe000ed00)=0x410cc601\nreadWord(addr=0x41002018)=0x10010305\nAtmel SMART device 0x10010005 found\nwrite(addr=0x20004000,size=0x34)\nwriteWord(addr=0x20004030,value=0x10)\nwriteWord(addr=0x20004020,value=0x20008000)\nDevice       : ATSAMD21G18A\nreadWord(addr=0)=0x20007ffc\nreadWord(addr=0xe000ed00)=0x410cc601\nreadWord(addr=0x41002018)=0x10010305\nChip ID      : 10010005\nversion()=v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43\nVersion      : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:43\nAddress      : 8192\nPages        : 3968\nPage Size    : 64 bytes\nTotal Size   : 248KB\nPlanes       : 1\nLock Regions : 16\nLocked       : readWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nreadWord(addr=0x41004020)=0xffff\nnone\nreadWord(addr=0x41004018)=0\nSecurity     : false\nBoot Flash   : true\nreadWord(addr=0x40000834)=0x7000a\nBOD          : true\nreadWord(addr=0x40000834)=0x7000a\nBOR          : true\nArduino      : FAST_CHIP_ERASE\nArduino      : FAST_MULTI_PAGE_WRITE\nArduino      : CAN_CHECKSUM_MEMORY_BUFFER\nErase flash\nchipErase(addr=0x2000)\ndone in 0.852 seconds\n\nWrite 16328 bytes to flash (256 pages)\nwrite(addr=0x20005000,size=0x1000)\nwriteBuffer(scr_addr=0x20005000, dst_addr=0x2000, size=0x1000)\n\r[=======                       ] 25% (64/256 pages)write(addr=0x20005000,size=0x1000)\nwriteBuffer(scr_addr=0x20005000, dst_addr=0x3000, size=0x1000)\n\r[===============               ] 50% (128/256 pages)write(addr=0x20005000,size=0x1000)\nwriteBuffer(scr_addr=0x20005000, dst_addr=0x4000, size=0x1000)\n\r[======================        ] 75% (192/256 pages)write(addr=0x20005000,size=0x1000)\nwriteBuffer(scr_addr=0x20005000, dst_addr=0x5000, size=0x1000)\n\r[==============================] 100% (256/256 pages)\ndone in 0.103 seconds\n\nVerify 16328 bytes of flash with checksum.\nchecksumBuffer(start_addr=0x2000, size=0x1000) = a16c\nchecksumBuffer(start_addr=0x3000, size=0x1000) = 684a\nchecksumBuffer(start_addr=0x4000, size=0x1000) = 4179\nchecksumBuffer(start_addr=0x5000, size=0xfc8) = efe8\nVerify successful\ndone in 0.014 seconds\nCPU reset.\nreadWord(addr=0)=0x20007ffc\nreadWord(addr=0xe000ed00)=0x410cc601\nreadWord(addr=0x41002018)=0x10010305\nwriteWord(addr=0xe000ed0c,value=0x5fa0004)\n",
    "stderr": ""
  },
  "flasher": {
    "stdout": "Flashing firmware /tmp/fwuploader/firmwares/WINC1500/19.6.1/m2m_aio_3a0.bin\nFlashed all the things\n",
    "stderr": ""
  }
}

The same applies to flash command.

Along the way I solved a 🐛 in #57

@umbynos umbynos added type: bug type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 15, 2021
@umbynos umbynos requested a review from a team June 15, 2021 17:05
@umbynos umbynos self-assigned this Jun 15, 2021
@umbynos umbynos removed the type: bug label Jun 15, 2021
@umbynos umbynos force-pushed the umbynos/json_output branch from d9d776b to 832a945 Compare June 15, 2021 17:24
@umbynos umbynos force-pushed the umbynos/json_output branch from 832a945 to 4b36452 Compare June 15, 2021 17:28
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some small changes to do but the rest is alright.

@umbynos umbynos merged commit e5f422a into main Jun 16, 2021
@umbynos umbynos deleted the umbynos/json_output branch June 16, 2021 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants