Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding NXP ADC Peripheral #536

Open
mjalili96 opened this issue Oct 21, 2023 · 3 comments
Open

Adding NXP ADC Peripheral #536

mjalili96 opened this issue Oct 21, 2023 · 3 comments

Comments

@mjalili96
Copy link

Hi, How we Can add a peripheral for NXP boards like I2C or ADC. can we use and stm32 ADC on a NXP board or use its CS file as a template?

@PiotrZierhoffer
Copy link
Member

Hi @mjalili96

In general, Renode models follow the reference manuals of specific SoCs - you can't really reuse STM ADC on NXP, unless you also use a driver for STM. You can think of our models as "anti-drivers" - they have to match.

You can of course use it as an example of how to write a model, but adjusting the register interface and internal logic will definitely be required.

@mjalili96
Copy link
Author

mjalili96 commented Oct 29, 2023

@PiotrZierhoffer Thanks for your response, what steps should I consider to add NXP ADC Peripheral? what changes in renode I have to make and what files need to be added and developed? I want a road map to do it
thanks

@PiotrZierhoffer
Copy link
Member

Hi @mjalili96

We have documented this process a bit: https://renode.readthedocs.io/en/latest/advanced/writing-peripherals.html

The general idea is to start with listing all registers and their fields as tags (like here: https://github.com/renode/renode-infrastructure/blob/3f1abde88ac5a2dae326b77ab91892f335e78f80//src/Emulator/Peripherals/Peripherals/I2C/MPFS_I2C.cs#L112), run your software, gather information from the Renode log on which fields and registers are actually used by the software, and add implementations of these specific registers.

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

No branches or pull requests

2 participants