-
Notifications
You must be signed in to change notification settings - Fork 51
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
Adding Chip erase and multithreading for make #496
Conversation
Oh, one more idea: How about auto-baud support? Of course, this would require some changes in avrdude to send the correct packets (maybe even a config file option?) but this would make it easier to increase programming speeds. P.S.: i have no idea how to add auto-baud support |
Um. Arduino IDE hasn't included Make in quite a long time... (not since they stopped using WinAVR as the toolchain, I believe.) Does the parallelism work? IIRC, a lot of optiboot targets compile to the same .elf file, and then rename it depending on the actual target (not sure about optiboot_dx) relatively late in the game... Wouldn't be good to parallel make different versions of optiboot_dx.elf... Autobaud is not always desirable. For instance, the "Arduino as ISP" programmer sketch uses 19200bps, at least partially to prevent the bootloader from looking like the programmer. |
Well, it was there in my Directory. I don't know why. (I used the indexing program Everything to look for a make.exe)
optiboot dx was calling make for each target through build_all_dx.bat so it always had to wait for the previous call to complete. However, make has support for multiple parallel jobs. Also, there are a lot of different configs for UART pins and Bootloader entry conditions plus different code for 128k and 64k, so we will need a couple of .elf
I haven't explained my though yet. As we need backwards compability, a starting baudrate is neccessary, there is no questioning of that. However, we could use the universal command to negotiate a baudrate (e.g. a lookup table with the usual baudrates, 10 = 115200, 15 = 230400, 17 = 250000 baud) and the bootloader sends the maximal possible value (e.g. 17 for dx), for optiboot_dx it would be 250000. ok, so while writing this, I realized that using auto-baud won't work, but I belive this negotiation is the best way to improve programming speeds of big devices EDIT: Maybe even have a parity when bumping up the speed |
Arduino can still use Make, via the CLI tools. See here : https://github.com/xxxajk/Arduino_Make The advantages of it is that you can do parallel builds no matter what, since each build gets a unique directory. Note too that the CLI tools DO accept a job thread number. |
Yeah I'd been thinking about this while I've been running around the past couple of weeks and haven't had time to attend to this - the chip erase is lovely in theory, but it hits rocks over the backwards compatibility. Thanks, I'll see if this builds for me! |
Ok so I hope this works.
Added mulithreading by creating extra receipies so that make will handle the parallelism itself.
Furthermore, I changed omake.bat to check for the Arduino IDE supplied make, basically allowing to build the bootloaders without installing anything else if you have the Arduino IDE installed, which I can kinda expect if you want to work with the DxCore.
This means, that you can just write (on windows)
omake all_dx -j8
to build all bootloaders for all dx parts (8 is the amount of parallel jobs, can be different)Chip erase is enabled (however I'd say it does not make anything faster) so I wonder if it should be even kept, as this is taking alot of space (at least 20 words). And we don't have any instruction to spare. So to support lower baudrates (BAUDH), we would have to replace jmp 0x200 with an rjmp .+(200-24) -_-. Or avoid erase at all. Side note: in order to check if the Flash is erased, i need to set FLMAP to 0 and can't restore it inside the bootloader, but i don't think this should matter.
Hopefully this will build ^^'
P.S.: As the Chip erase is ignored in the old bootloader, The core should be backwards compatible.