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

Make ability to set DebugSequence externally #2328

Closed
wants to merge 32 commits into from

Conversation

Kuraga13
Copy link
Contributor

    /// Set DebugSequence on Target. Change sequence external, on runtime etc.
    pub fn set_debug_sequense(&mut self,  sequence : DebugSequence) {
        self.debug_sequence = sequence;
    }

motivation

there is no need to add config to the project i.e. each sequence, this can be done externally, including at runtime

example

/* add externally target from YAML */
const SOME_ARM: &[u8] = include_bytes!("../arm_target/arm_targets_yaml/SOME_ARM.yaml");
...
probe_rs::config::add_target_from_yaml(SOME_ARM).map_err(|err | Error::InternalError("add_target_from_yaml SOME_ARM".to_string()))?;
...
/* init target sequence */
let debug_sequence = if target.name.starts_with("SomeArm") {
 DebugSequence::Arm(SomeArm::create())
} else  { DebugSequence::Arm(DefaultArmSequence::create()) };
 target.set_debug_sequense(debug_sequence);

@Kuraga13
Copy link
Contributor Author

Sorry, It's not ideal that everything is combined in one PR. FlashAlgorithm assemble_from_raw_with_data also to be updated in this pull request. Allow page_size = 2, as used in the EEPROM flash algorithm, for example, mke02zxxx_ee256b. Also, for the USB interface on StLink, use the interface_number from the descriptor.

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.

None yet

2 participants