2

Here is the picture of a variable placement in STM32L152VBX memory with IAR IDE (8.30). I am using C.

  • _gprs_inited is a static variable (8bit),
  • send_data_with_gprs is a function,
  • _failed_gprs_counter is a static variable (8bit) declared inside the function.

memroy location

Does this mean both the variables are allocated in the same address?

I mean since both are 8 bit variables, and the processor is 32bit it can hold those two?

Blue
  • 820
  • 4
  • 17
Harikrishnan
  • 3,664
  • 7
  • 48
  • 77
  • Is it C++.? You do not have to worry or variables will have distinct storage locations – 0___________ Jun 19 '19 at 07:27
  • Have linker generate the map file, and look what it says. What version of IAR is this? – user694733 Jun 19 '19 at 07:37
  • I am using IAR 8.30, and it is C – Harikrishnan Jun 19 '19 at 08:53
  • 1
    `0x20001488` is different from `0x20001489`, how can it mean they have the same address? `the processor is 32bit` - processor supports instructions operating on 32-bit registers, but the memory is byte-addressable. – KamilCuk Jun 19 '19 at 09:38
  • With the limited information presented in the question my guess is that it is a bug in the presentation of code in the ide, but without a [mcve] it can be nothing more than a guess. Have you considered contacting IAR support? – Johan Jun 19 '19 at 10:46
  • Thanks for the reply. It is a huge project, and I am not allowed to submit it. I will try with linked map file. – Harikrishnan Jun 20 '19 at 04:38

0 Answers0