Skip to main content
Barber.Mark
Associate III
Nov 20, 2025 4:41 AM UTC
Question

STM32CubeIDE routines will not return double values correctly

Hi,

i have a confusing problem, i have a simple routine to compute values and it needs to return the result as a double. just before the return the value is correct but the calling routine does not get passed this value. i know there can be some alignment issues with double variables. i am using STM32CubeIDE Ver 1.18.1 To overcome i simple create a global variable and assign this the right value and it all works. however why am i not able to return the double value?

any help appreciated.

Mark

2 replies

Associate II
Nov 20, 2025 5:50 AM UTC

Hi Mark,

can you please provide more details?

Which MC or board do you use? Which project settings apply? How does your code look like?

 

A full example (as small as possible) would help to help you.

 

BR Klaus

 

Andrew Neil
Super User
Nov 20, 2025 10:05 AM UTC

Remember that we can't see your code, so can't comment on what might be wrong.

Therefore, as @mfgkw said, please show a minimum but complete example which illustrates.

See: How to insert source code

Also: How to write your question to maximize your chances to find a solution

 

How do you observe the value? Are you sure this isn't just a problem with the debugger not properly presenting double values...?

 


@Barber.Mark wrote:

i am using STM32CubeIDE Ver 1.18.1


Note that this is rather old - current version is 2.0.0.

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.