FCL Flash driver for F1KMS4 is not working with IAR compiler

Background:

We are in the process of porting our firmware to the Renesas F1KMS4 microcontroller family. As part of this effort, we have successfully:

Ported all required source files (including FCL drivers)

Updated linker scripts and memory mapping

Configured the necessary FDLM0

Ensured RAM sections used by FCL are initialized before FCL initialization

Problem Statement:


The FCL initialization fails when running standalone (without debugger attached). The code either:

Returns an FCL init failure status

Or sometimes branches to an unknown location, leading to unpredictable behavior.

Interestingly, when we run the same firmware with a debugger attached, the FCL initialization completes successfully and flash operations (erase/write) work as expected.
any suggestion?