Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


You are viewing a reply to Error while debuging  

working with complex numbers

Hi! Greetings!

I am working with complex numbers on STM32L0 nucleo board using SW4STM32 eclipse.

My abstract code:

while()
{
...other statements...which calculate the value of znext to be 2.76623654 + -0.352664977 * I
volatile _Complex float znprev=zn;
volatile _Complex float zn=znext; //I am not able to get the value of ‘znext’ to be transferred to ‘zn’.
}

Meanwhile if I keep the cursor on ‘zn’ in run mode, I get following:

Name : zn
Details:2.76623654 + -0.352664977 * I
Default:3.5 + 0 * I
Decimal:3 + 0 * I
Hex:0x3 + 0x0 * I
Binary:11 + 0 * I
Octal:03 + 0 * I

Why the value displayed in “Default” does not get replaced by the value in “Details”?
I also have tried using the syntax “complex volatile float” and “volatile complex float”.
Sometimes I get in the output. I tried setting different optimization levels and finally kept “Optimize for Debug (-Og)”

Please provide your suggestions.
Regards,
Sanket

Hi Sanket! Greetings!
Please, note that this forum is mainly used for Eclipse/SW4STM32 related discussions.
You may get more comments in using forum dedicated to C coding.

Anyway, I made trials but didn’t manage to reproduce this issue.
In my test code, I included complex.h : the Standard Library of Complex Numbers
The variables are declared with the following line :
volatile float complex z0, z1, z, zprev, znext; // imaginary 32-bit number

In the attached snapshot, you can see :
- the code of the main function;
- both parts of the complex variables updated;

I hope it can help.


 

Newest Forum Posts

  1. STM32 MCU model shortlisting for Making RC remote by Palvish, 2025-07-07 15:05
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs