unload firmware and avr_t struccture

22 views
Skip to first unread message

Christoph Hintermüller

unread,
Aug 22, 2017, 2:40:38 PM8/22/17
to simavr
Hi

Again me

For my project it is necessary to exchange firmware without closing the program as well as exchanging the simulated avr model without closing the program.

Are there any functions which cleanly free the firmware object? What has to be considered when writing a close_firmware function.
Is there any function for unloading firmware from avr_t to replace it with new firmware without exiting program?;

What are the terminate and restet functions for the avr_t type do. do they fully deallocate and return avr_t structure back before avr_make_mcu_by_name ( f . mmcu ) was called?

Best
Xristoph


M P

unread,
Aug 23, 2017, 3:59:24 AM8/23/17
to simavr
It might be a lot easier to create a new avr with the new model and
load a new firmware, I'm pretty sure there isn't any globals in
simavr, so you can have as many as you like really...

You *can't* change the model of avr on the same structure, as the
structure is sized FOR the avr it's emulating, the avr_t core is
shared, but there is a 'meta' structure per core that contains all the
peripherals.

M


On 22 August 2017 at 19:40, Christoph Hintermüller
> --
> You received this message because you are subscribed to the Google Groups
> "simavr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to simavr+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Christoph Hintermüller

unread,
Aug 24, 2017, 4:05:19 AM8/24/17
to simavr
Hi

If found it already my self

As you say

it is basically the reset and terminate functions which clear the memory for the avr_t and afterwards free the avr_t structure and recreate it a new with make_from name
I just made a small fix in my branch the terminate function to ensure all memory is cleared.

For loading a new distinct firmware i modified the load firmware function a bit, in my branch now checking if avr_t structure has already a firmware loaded and removes any memory previously added by previous firmware and allocating afterwards anew.

To unload the firmware i added in my branch a close_firmware function to delete the function, to be able to clear all the memory the firmware object occupies.
No provision taken in case still loaded into avr_t (not replaced by new firmware) and no call to reset and terminate took place before close



Am Mittwoch, 23. August 2017 09:59:24 UTC+2 schrieb buserror:
It might be a lot easier to create a new avr with the new model and
load a new firmware, I'm pretty sure there isn't any globals in
simavr, so you can have as many as you like really...


after call to reset a small change to load_firmware should do the trick (see above)

 
You *can't* change the model of avr on the same structure, as the
structure is sized FOR the avr it's emulating, the avr_t core is
shared, but there is a 'meta' structure per core that contains all the
peripherals.


I allready saw, see above.
 

thanks anyway

Best
Xristoph

Reply all
Reply to author
Forward
0 new messages