As schroeder has already pointed out, to identify buffer overflow vulnerabilities, you'd need to test the application locally with a debugger. It seems to me that you haven't actually gone through the process of learning to identify and debugging possibly vulnerable applications to buffer overflow.
Instead of walking you through the basics of the process ...
To find and write exploits for vulnerabilities such as a buffer overflow require privileged access to attach debugger, restart the crashed process, etc.
Once the exploit is written, it can often be used reliably against remote targets where you do not have any access.
Most bug hunters/exploit writers I know maintain a library of virtual (and or physical) ...
DEP/ASLR is just layer of security. It doesn't secure you against everything, and against any sophisticated attack in particular. Unlike @ConsideredHarmful thinks, DEP/ASLR being disabled alone isn't a vulnerability, as DEP/ASLR just adds a layer of complexity to an attack by randomising memory locations.
The security paradigm in general should be not to ...
TL,DR: There's no way.
a microcontroller with no hardware support for security.
No hardware support means you need to do all by software, and that means an attacker can use the same software as you. Your data must be decrypted by software, so the attacker can alter your firmware and dump all data, including the keys.
In a microcontroller with security ...
Read-only means one can only read from it. Write-protected means that writing is possible but controlled. Those controls can fail.
If "read-only" is defined in the hardware, then it will always be write-protected at the same time.
OTP memory is OTP. After being burned, it is read-only.
Program crashes save minidumps that contain some parts of the process memory, including thread contexts, some active pages, the stack, etc.
The solution for all of these, though, is to use full-disk encryption (FDE). That way it doesn't matter what data is written to the disk - memory dumps, logs, cached files, etc. - they're all encrypted at rest anyway.