SVD files for LPC822/LPC824 are broken

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SVD files for LPC822/LPC824 are broken

1,124件の閲覧回数
hannobraun
Contributor II

Hello,

a while ago I posted about problems I found in the LPC82x SVD file. I recently noticed that newer SVD files for LPC822 and LPC824 are available via the MCUXpresso SDK Builder, so I tried updating my LPC82x Rust bindings based on the new files.

While those new files fix all the errors that I previously reported (thank you!), I found many new problems in them. Some of them are obvious and easy to fix. But a large number of them are subtle, and could lead to subtle bugs in programs that rely on the correctness of those files. For this reason, I will stay away from those files, and recommend anyone who considers using them do the same.

As I said before, some of the bugs are obvious and easy to fix. But there's a large number of incorrect reset masks, that I believe could turn into a debugging nightmare for anyone using language bindings based on those files. Here's a list of bugs I found, with links to commits in my work-in-progress branch that fix them (since the LPC822 and LPC824 files are virtually identical, these problems apply to both):

  1. Missing interrupts (commit) - Interrupts are missing that were present in the old file.
  2. Comparator control register (commit) - Wrong field values in comparator control register
  3. MRT0 reset mask (commit) - Incorrect reset masks in MRT0 peripheral.
  4. ADC reset values and masks (commit) - Incorrect reset values and reset masks in ADC peripheral.
  5. ACOMP reset mask (commit) - Incorrect reset mask in ACOMP peripheral.
  6. INPUTMUX reset masks (commit) - Incorrect reset masks in INPUTMUX peripheral.
  7. FLASH_CTRL reset value (commit) - Incorrect reset value in FLASH_CTRL peripheral.
  8. IOCON register block size (commit) - IOCON register block has the wrong size.

Please note that I haven't reviewed these fixes. As I said, this branch is in a work-in-progress state, and I gave up on using the files due to the numerous errors.

In addition to the bugs that I fixed in my branch, there are some more problems that I found, but don't have fixes for:

  1. ADC0 is missing a lot of enumerated values that were present in the old file.
  2. INPUTMUX is missing enumerated values that were present in the old file for the INP field in DMA_INMUX_INMUX and the INP_N field in SCT0_INMUX.
  3. The FLASHTIM field in the FLASHCFG register has two reserved values (0x2, 0x3) according to the user manual, but 0x2 is not reserved in the SVD.
  4. The registers in the IOCON peripheral have the wrong names.

And lastly, I found something that looked odd in the user manual itself: The TIMER registers in MRT0 have a field called VALUE. According to the user manual, the reset value for that field is 0x00FFFFFF, which looks odd for a 31-bit field. It also contradicts the register overview, which gives a reset value of 0x7FFFFFFF for the register.

I'd like to emphasize that all these errors in the reset masks are extremely damaging to my use case. They could cause single bits or groups of bits in registers to have unexpected values. That could lead to really weird bugs that are hard to find, because they are buried in the generated peripheral access code. I hope that it will be possible to fix all these mistakes and get solid versions of these SVD files. I thank NXP for all the effort they've expended on these files so far!

ラベル(1)
0 件の賞賛
4 返答(返信)

800件の閲覧回数
hannobraun
Contributor II

I just checked, and it seems the latest versions of the SVD files available via MCUXpresso SDK Builder still have the problems I reported.

jeremyzhou‌, do you know whether this is something that's going to be fixed any time soon? Thank you!

0 件の賞賛

800件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Hanno Braun,

Please create a request about this report , I will escalate its priority to be solved.

pastedImage_1.png

Have a great day.

TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛

800件の閲覧回数
hannobraun
Contributor II

Thank you, jeremyzhou‌!

I've created support request 00201109. Unfortunately it looks like to me like all my formatting was removed, making the description quite horrible to read. I hope it looks better on your end.

0 件の賞賛

800件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Hanno Braun,

Thank you for your interest in NXP Semiconductor products and 
for the opportunity to serve you.

Thank you for your information

Have a great day.

TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛