[ABANDONED] unions with structs dont display properly

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] unions with structs dont display properly

    union with struct overlaying with U32 & array of 2 U16
    U32 & 2 U16s show ok
    struct doesn't but all show as the same address [ as you would expect ]

    typedef union
    {
    struct
    {
    uint32_t PowerEnable : 1;
    uint32_t Startup : 1;
    uint32_t Fault : 1;
    uint32_t HwFault : 1;

    uint32_t Present : 1;
    uint32_t xExpanderPresent : 1;
    uint32_t xExpanderOk: 1;
    uint32_t : 1;
    uint32_t xChargerPresent : 1;
    uint32_t xChargerOk : 1;
    uint32_t SmartBattPresent : 1;
    uint32_t SmartBattOk : 1;
    uint32_t : 4;

    uint32_t HwFaultShadow : 1;
    uint32_t Updated : 1;
    uint32_t Channel : 1;
    } ;
    uint32_t u32;
    uint16_t aU16[2];
    } UnBatteryStatusReg;
  • Hello,

    Thank you for your inquiry.
    Which version of Ozone are you using exactly?
    Do you see the same issue in the latest version?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    Do you see the same issue in the latest version?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • no

    typedef union
    {
    struct
    {
    uint32_t SldEn : 1;
    uint32_t TecEn : 1;
    uint32_t IntegrationCap : 1;
    uint32_t : 1;
    uint32_t SaveCal : 1;
    uint32_t LoadCal : 1;
    uint32_t LoadCalToSystem: 1;
    uint32_t RebootFpga : 1;

    uint32_t StopAnMux : 8;
    uint32_t EraseFgpaFirmware1 : 8;
    uint32_t EraseFgpaFirmware2 : 8;
    };
    uint32_t U32;
    } UnControlReg;

    you can see in the picture the bottom 2 bits are set in the U32 but you dont display any of the struct values
    Images
    • Untitled.png

      49.41 kB, 917×418, viewed 226 times
  • Ok now I am confused.
    I ask if the issue is in the latest version and you write no. Yet you post a reproducer.
    I assume this is not resolved yet, correct?

    We will check if the issue is reproducible and report back with our findings.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    The reported behaviour is not reproducible for me with Ozone V3.26h, see picture attached.
    Could you provide an example project for reproduction that would run on an eval board?
    An elf file + the Ozone project .jdebug file should be sufficent.

    Best regards,
    Nino
    Images
    • Capture.PNG

      13.66 kB, 711×329, viewed 213 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • it's compiled under IAR


    this is a dump out of that union + another one using the iar ielfdumper tool


    0x1'a743: | + union_type (82)
    | | sibling 0x1'a7d1
    | | name UnControlReg
    | | byte_size 0x4
    0x1'a756: | | member (86)
    | | type 0x1'a76c
    | | accessibility public
    | | data_member_location [plus_uconst 0]
    0x1'a75f: | | member (49)
    | | type 0x1'a9a5
    | | accessibility public
    | | name u32
    | | data_member_location [plus_uconst 0]
    0x1'a76c: | | + structure_type (87)
    | | | sibling 0x1'a7d0
    | | | byte_size 0x4
    0x1'a772: | | | member (88)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | name OpenLoop
    | | | data_bit_offset 0x0
    | | | bit_size 1
    0x1'a783: | | | member (88)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | name SaveCal
    | | | data_bit_offset 0x1
    | | | bit_size 1
    0x1'a793: | | | member (88)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | name LoadCal
    | | | data_bit_offset 0x2
    | | | bit_size 1
    0x1'a7a3: | | | member (92)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | data_bit_offset 0x3
    | | | bit_size 1
    0x1'a7ab: | | | member (88)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | name EraseCal1
    | | | data_bit_offset 0x4
    | | | bit_size 8
    0x1'a7bd: | | | member (88)
    | | | type 0x1'a9a5
    | | | accessibility public
    | | | name EraseCal2
    | | | data_bit_offset 0xc
    | | | bit_size 8
    | | +-- 0
    | +-- 0

    0x1'1ebd: | + union_type (64)
    | | sibling 0x1'2012
    | | name UnStatusReg
    | | byte_size 0x4
    0x1'1ecf: | | member (70)
    | | type 0x1'1ee5
    | | accessibility public
    | | data_member_location [plus_uconst 0]
    0x1'1ed8: | | member (39)
    | | type 0x1'2204
    | | accessibility public
    | | name u32
    | | data_member_location [plus_uconst 0]
    0x1'1ee5: | | + structure_type (65)
    | | | sibling 0x1'2011
    | | | byte_size 0x4
    0x1'1eeb: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name ADCUpdated
    | | | data_bit_offset 0x0
    | | | bit_size 1
    0x1'1efe: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name TestMode
    | | | data_bit_offset 0x1
    | | | bit_size 1
    0x1'1f0f: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name CalDataValid
    | | | data_bit_offset 0x2
    | | | bit_size 1
    0x1'1f24: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name StartingUp
    | | | data_bit_offset 0x3
    | | | bit_size 1
    0x1'1f37: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name DoingStartUpChecks
    | | | data_bit_offset 0x4
    | | | bit_size 1
    0x1'1f52: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name BadPressureSensor
    | | | data_bit_offset 0x5
    | | | bit_size 1
    0x1'1f6c: | | | member (67)
    | | | type 0x1'2204
    | | | accessibility public
    | | | data_bit_offset 0x6
    | | | bit_size 2
    0x1'1f74: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name EepromFound
    | | | data_bit_offset 0x8
    | | | bit_size 1
    0x1'1f88: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name EepromOk
    | | | data_bit_offset 0x9
    | | | bit_size 1
    0x1'1f99: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name DriverFound
    | | | data_bit_offset 0xa
    | | | bit_size 1
    0x1'1fad: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name DriverOk
    | | | data_bit_offset 0xb
    | | | bit_size 1
    0x1'1fbe: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name AmbPressFound
    | | | data_bit_offset 0xc
    | | | bit_size 1
    0x1'1fd4: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name AmbPressOk
    | | | data_bit_offset 0xd
    | | | bit_size 1
    0x1'1fe7: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name OutPressFound
    | | | data_bit_offset 0xe
    | | | bit_size 1
    0x1'1ffd: | | | member (66)
    | | | type 0x1'2204
    | | | accessibility public
    | | | name OutPressOk
    | | | data_bit_offset 0xf
    | | | bit_size 1
    | | +-- 0
    | +-- 0
  • Hello,

    Unfortunately this is not helping.
    We would need to reproduce the behaviour on hardware.
    Could you provide an example project for reproduction that would run on an eval board?
    An elf file + the Ozone project .jdebug file should be sufficent.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • how do I know what boards you have ?

    this elf file is for a samd20J17

    it won't run on any hardware you have but you can find the "Registers" global object to find a bunch of examples of those structures
    Files
    • c.out.zip

      (385.63 kB, downloaded 188 times, last: )
  • Hello,


    AndyR wrote:

    how do I know what boards you have ?
    This should not matter. This is a pure software issue and should be target independent, correct?
    So if you could provide us with an reproduction project that could run on any Arm Cortex-M eval board that would be helpful.
    We have over 3500 evalboards in house so there is a good chance that we already have it. If not we will get it.


    AndyR wrote:

    this elf file is for a samd20J17
    Ok good. We have e.g. the SAM D20 Xplained Pro in house.


    AndyR wrote:

    it won't run on any hardware you have but you can find the "Registers" global object to find a bunch of examples of those structures
    We would need a project that could run on an evalboard. A simple stripped down project that shows this behaviour would be sufficient.
    Could you provide this?
    Please understand that the time we can spend on investigations is very limited which is why it is a requirement that in case of bug reports a universal reproduction setup is provided as we can't spend an undefined amount of time on trial and error without guarantee for success.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • well just download it, find the instance of the structure and just change the U32 / memory fundamental value . that is all you need to show the issue as "Registers" is a global static variable with the union structs inside it