Skip to content

Fix embedded binary parameter loading #40

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

Merged
merged 13 commits into from
Apr 4, 2019
Merged

Conversation

at-wat
Copy link
Member

@at-wat at-wat commented Mar 26, 2019

fix #42

@at-wat at-wat self-assigned this Mar 26, 2019
@at-wat at-wat changed the title Fix embedded binary parameter struct alignment Fix embedded binary parameter loading Mar 26, 2019
printf("enc_rev: %d, %d\n\r", motor_param[0].enc_rev, motor_param[1].enc_rev);
printf("enc_denominator: %d, %d\n\r", motor_param[0].enc_denominator, motor_param[1].enc_denominator);
printf("enc_rev_raw: %d, %d\n\r", motor_param[0].enc_rev_raw, motor_param[1].enc_rev_raw);
AT91C_BASE_RSTC->RSTC_RCR = 0xA5000000 | AT91C_RSTC_EXTRST | AT91C_RSTC_PROCRST | AT91C_RSTC_PERRST;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need parameter version check. otherwise, endless reset loop occurs.

@at-wat
Copy link
Member Author

at-wat commented Mar 29, 2019

Before adding a new field.

0177AA003500010000003001756E6B6E6F776E00000000000000000000000000
000000000000000000000000B0040A000100000000000000FFFF

After adding the char field at the end (deafult value 0xAA).

0177AA003600010000003001756E6B6E6F776E00000000000000000000000000
000000000000000000000000B0040A000100000000AA0000FFFF

Size is calculated correctly even if the size() is not changed due to the trailing padding.

-- Locomotion Board 1.5 --
-- T-frog Motor Driver rev.5
-- Compiled: Mar 29 2019 15:43:56 --
User Reset. NRST pin detected low.
SRAM init
FPGA ID: 1a0
FPGA test
ADC init
Migrating EEPROM data  # <- migrated as expected
Velocity Control init
PWM control init
Watchdog init
Start ticker
RS485 init
Board version: R6, R6A
Entering main control loop

@at-wat at-wat requested a review from DaikiMaekawa April 2, 2019 09:06
@at-wat
Copy link
Member Author

at-wat commented Apr 2, 2019

@DaikiMaekawa please take a look. sorry, this will make conflicts with your PR.

@at-wat at-wat merged commit a10213d into master Apr 4, 2019
@at-wat at-wat deleted the fix-embedded-param-alignment branch April 4, 2019 14:53
@at-wat at-wat mentioned this pull request May 29, 2019
15 tasks
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.

Overdetecting ERROR_HALL_ENC on binary embedded parameter mode
2 participants