Stack Overflow Issues with CY8C4245AXI-483 Bootloader Implementation on ESP32
Posted: Wed Apr 17, 2024 6:43 am
Hello Community,
I am currently working on a project involving the CY8C4245AXI-483 microcontroller where I have developed a bootloadable and a custom bootloader. For the bootloader host, I am utilizing the host code provided by Infineon, adapted to run on an ESP32.
Issue Summary:
I am encountering intermittent stack overflow issues during operation. The problem seems to be exacerbated by deep function calls within the bootloader code. Despite efforts to manage and optimize the code structure, the issue persists, affecting the stability and reliability of the bootloader operation.
Technical Details:
Microcontroller Used: CY8C4245AXI-483
Additional Hardware: ESP32 for implementing the bootloader host
Observations:
The issue occurs intermittently, particularly under conditions of heavy load or specific operational scenarios.
Deeply nested function calls appear to be a contributing factor.
Adjustments to stack size and optimizations in recursion have been partially successful.
Attempts to Resolve:
Refactoring recursive functions to iterative ones where possible.
Reducing the number of local variables in deeply nested functions.
Attachments:
Debug logs capturing the incidents of stack overflow.
Code snippets of the bootloader functions with deep calls.
Best regards,
I am currently working on a project involving the CY8C4245AXI-483 microcontroller where I have developed a bootloadable and a custom bootloader. For the bootloader host, I am utilizing the host code provided by Infineon, adapted to run on an ESP32.
Issue Summary:
I am encountering intermittent stack overflow issues during operation. The problem seems to be exacerbated by deep function calls within the bootloader code. Despite efforts to manage and optimize the code structure, the issue persists, affecting the stability and reliability of the bootloader operation.
Technical Details:
Microcontroller Used: CY8C4245AXI-483
Additional Hardware: ESP32 for implementing the bootloader host
Observations:
The issue occurs intermittently, particularly under conditions of heavy load or specific operational scenarios.
Deeply nested function calls appear to be a contributing factor.
Adjustments to stack size and optimizations in recursion have been partially successful.
Attempts to Resolve:
Refactoring recursive functions to iterative ones where possible.
Reducing the number of local variables in deeply nested functions.
Attachments:
Debug logs capturing the incidents of stack overflow.
Code snippets of the bootloader functions with deep calls.
Best regards,