Reset if the program is jumped to the unused flash area

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

We would like to reset if the program is jumped to the unused flash area.

Do you have any good ideas about that?

Best regards,

Yocchi

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is a NMI when accessing non-existing memory areas. This currently jumps to an infinite loop for better debugging. You may provide your own interrupt handler and perform a CySoftwareReset().

Bob

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is a NMI when accessing non-existing memory areas. This currently jumps to an infinite loop for better debugging. You may provide your own interrupt handler and perform a CySoftwareReset().

Bob

0 Likes
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Fill the unused area of Flash ROM with any UNDEFINED instruction. So it is available to cause an illegal instruction exception when entering to the unused flash ROM area.

I found an article at the following URL

FILLing unused Memory with the GNU Linker | MCU on Eclipse

It seems available to modify the linker script to fill the unused Flash ROM area.  This article is not for PSoC 4, but it is available to adapt to PSoC Creator's linker script.

Will anyone try to implement?

Regards,

Noriaki

0 Likes

Hello,

Thank you very much for advice.

Can I set the filling unused memory in PSoC Creator?

Best regards,

Yocchi

0 Likes

Assuming you are asking Flash memory, it is not possible to fill any value in unused memory in PSoC Creator.

0 Likes

Hello,

Thank you very much.

I could fill the unused flash area with unique data(for example :0xe7fe this means "loopa: b loopa")

by using GNU Linker Script.

PSoC Creator can use the custom linker script like below.

Locating Object Files at a Specific Memory Section in PSoC® Creator™- GCC Compiler Linker Script Fil...

Best rergards,

Yocchi

0 Likes

You meant you wanted to fill the unique data when you build project in PSoC Creator... instead of dynamic change in PSoC Creator...

Yes, you would be able to do this with what you mentioned above.

0 Likes