Main application to a secondary application

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Main application to a secondary application

Post by Kisen »

Hi,

I am working on a project that essentially requires a bootloader. But i dont really want to use a bootloader in the traditional sense.

I have a main application that performs various tasks. One of which is to download from the internet a hex file and store it in an external memory.
At a certain time of day, I want the main application to check to see if an update has been downloaded. If it meets the criteria, I want my application to complete its tasks and then jump into a second sub application.

This second application will get the data from the external memory and program it into the main application memory space. There is also a fancy light show which means constant update from I2C using interrputs. This will mean using SPI, I2C and Interrupts in both applications. Upon completion of the re-write of main application memory, there would be a reset command issued where the main application will start again.

I am using an STM32 IC with plenty of memory. 128KB currently.

Does this sound practical? I think it would be because it just seems like a more elaborate bootloader.

If i am on the right track then how would i go about jumping out of the main application and into a sub application?
How would i program a sub application to a specific place? (like a bootloader would be)
Is it possible to use different interrupt routines in 2 different programs?

Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Main application to a secondary application

Post by Kisen »

I have been looking at this a little closer.

I will be needing to implement something like the following.

0x08000000 - 0x8003FFF = BOOTLOADER SPACE = 16KB
0x08004000 - 0x08007FFF = RESERVED = 16KB
0x08008000 - 0x08027FFF = MAIN APPLICATION DATA SPACE = 128KB
0x08028000 - 0x0802BFFF = RESERVED = 16KB
0x0802C000 - 0x0803FFFF = SECOND APPLICATION DATA SPACE = 80KB+ Remaining.


The bootloader is what i would like to accomplish first of all.
The bootloaders task will be to check some data that is stored on an external memory (using spi) Depending on the outcome of this it will either jump to the MAIN APPLICATION or the SECOND APPLICATION.

If u use flowcode to create this bootloader, How do i go about making the jump to the new program and is there anything else i need to do or will the program just start running when the jump is made?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Main application to a secondary application

Post by Benj »

Hello,

Sounds like an interesting project.

The STM32 devices have an onboard USB and Serial bootloader that you should be able to invoke. Though you may need a simple external microcontroller to enable you to do this. I beleive you simply reset the chip with a pin held in a specific state to engage the bootloader mode.

Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Main application to a secondary application

Post by Kisen »

Hi Ben,

The internal bootloader isnt really what i am looking for since i use SPI to get data from an onboard, external memory.

The main area of interest for me right now is how to jump from one application into another. Have you any experience with this?

Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Main application to a secondary application

Post by Kisen »

I am also trying to program into a specific memory address. Is this something the compiler deals with??

Post Reply