Skip to content

Conversation

@xiaoxiang781216
Copy link
Contributor

@xiaoxiang781216 xiaoxiang781216 commented Jan 16, 2023

Summary

chip/sam_clockconfig.c: In function 'sam_usbclockconfig': Error: /github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:51: error: 'regval' is used uninitialized [-Werror=uninitialized]
  135 | #define putreg32(v,a)  (*(volatile uint32_t *)(a) = (v))
      |                                                   ^
chip/sam_clockconfig.c:422:12: note: 'regval' was declared here
  422 |   uint32_t regval;
      |            ^~~~~~

Impact

Fix CI broken by #8141

Testing

Pass CI

@acassis
Copy link
Contributor

acassis commented Jan 16, 2023

@TimJTi could you please double check this issue came from you commit 6b4da4a

chip/sam_clockconfig.c: In function 'sam_usbclockconfig':
Error: /github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:135:51: error: 'regval' is used uninitialized [-Werror=uninitialized]
  135 | #define putreg32(v,a)  (*(volatile uint32_t *)(a) = (v))
      |                                                   ^
chip/sam_clockconfig.c:422:12: note: 'regval' was declared here
  422 |   uint32_t regval;
      |            ^~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
@TimJTi
Copy link
Contributor

TimJTi commented Jan 16, 2023

@TimJTi could you please double check this issue came from you commit 6b4da4a

Not sure I fully understand what the issue is?

@TimJTi
Copy link
Contributor

TimJTi commented Jan 16, 2023

@TimJTi could you please double check this issue came from you commit 6b4da4a

Not sure I fully understand what the issue is?

Oh, perhaps I do. Perhaps the #endif for the #define checks is too soon and should be after the putreg on line 473.

I need to check sam_sfr.h as it is related to that.

It all stems from the fact that the SAMA5D4 does not have TRIM capability for UTMI unlike SAMA5D2 and D3 but early datasheets did include this.

I will look tomorrow at my PR and do changes as required as I don't think reverting the line:

#if defined(ATSAMA5D2) || defined(ATSAMA5D3)

is necessarily the right answer

@xiaoxiang781216
Copy link
Contributor Author

Done.

@TimJTi
Copy link
Contributor

TimJTi commented Jan 16, 2023

Done.

Cool. I had tested with an "undef" of ATSAMA5D2 in this file, and a local #define of ATSAMA5D3 and ATSAMA5D4, but that missed other defines in other files so will try and do better coverage with my checks in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants