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

Inconsistent behaviour between gcc and armcc #3

Open
Thalhammer opened this issue Nov 12, 2018 · 0 comments
Open

Inconsistent behaviour between gcc and armcc #3

Thalhammer opened this issue Nov 12, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Thalhammer
Copy link
Owner

qapi_GPIO_ID_t     gpio_id = 0;
qapi_TLMM_Config_t tlmm_config;
qapi_Status_t      status = QAPI_OK;
	
memset(&tlmm_config, 0, sizeof(tlmm_config));
tlmm_config.pin = 8; // Pin 11 is GPIO3
tlmm_config.func = 0;
tlmm_config.dir = QAPI_GPIO_INPUT_E;
tlmm_config.pull = QAPI_GPIO_PULL_UP_E;
tlmm_config.drive = QAPI_GPIO_2MA_E;

status = qapi_TLMM_Get_Gpio_ID( &tlmm_config, &gpio_id);

if (status == QAPI_OK) {
	status = qapi_TLMM_Config_Gpio(gpio_id, &tlmm_config);
}

In armcc everything works fine, but gcc somehow modifies the first byte/word of tlmm_config in the call to qapi_TLMM_Get_Gpio_ID and writes a zero there, causing the consecutive call to qapi_TLMM_Config_Gpio to fail with ERR_INVALID_PARAM. I don't know why this happens only in gcc.
This is a tracking issue to gather ideas until I figured this out.

@Thalhammer Thalhammer self-assigned this Nov 12, 2018
@Thalhammer Thalhammer added the bug Something isn't working label Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant