Avatar ·

Building C++ Application for Operation in High Radiation Environments: Fault Protection

Hi everyone. I'm writing embedded software in C++ for a device that will operate inside a nuclear reactor (temperature monitoring system). The radiation level there is insane.\n\nI've already encountered that after a couple of weeks of operation, the program starts behaving strangely: calculations give incorrect results, sometimes segmentation faults occur, and a couple of times the controller just froze. I suspect this is due to bit errors in RAM and flash memory caused by radiation.\n\nMy current code looks like this:\n\n```cpp\nint main() {\n int sensor_value = read_sensor(); // function that reads ADC\n int threshold = 100;\n if (sensor_value > threshold) {\n activate_alarm();\n }\n return 0;\n}\n```\n\nI'm compiling with GCC for ARM Cortex-M4 with flags `-O2 -std=c++17`. The question is: how can I modify