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

qdec in same70q21b not compiling, however in same70q21 works #65432

Closed
tswaehn opened this issue Nov 18, 2023 · 4 comments · Fixed by #68189
Closed

qdec in same70q21b not compiling, however in same70q21 works #65432

tswaehn opened this issue Nov 18, 2023 · 4 comments · Fixed by #68189
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) priority: low Low impact/importance bug

Comments

@tswaehn
Copy link
Contributor

tswaehn commented Nov 18, 2023

It looks like there is an issue with using the QDEC in same70q21b vs same70q21.

When compiling with enabled sam-qdec I get an issue in that file:
drivers/sensor/qdec_sam/qdec_sam.c

missing definition of TC_CMR_ETRGEDG_NONE

.../zephyr/drivers/sensor/qdec_sam/qdec_sam.c: In function 'qdec_sam_configure':
.../zephyr/drivers/sensor/qdec_sam/qdec_sam.c:90:27: error: 'TC_CMR_ETRGEDG_NONE' undeclared (first use in this function); did you mean 'TC_CMR_ETRGEDG_Pos'?
   90 |                         | TC_CMR_ETRGEDG_NONE

this definition is present in:

asf/sam/include/same70/component/tc.h

but not present in:
asf/sam/include/same70b/component/tc.h

steps to reproduce
cmake
-DBOARD=sam_e70b_xplained (fails) vs -DBOARD=sam_e70_xplained (works)

dt

&tc0 {
	status = "okay";
	compatible = "atmel,sam-tc-qdec";

	pinctrl-0 = <&tc0_qdec_default>;
	pinctrl-names = "default";
	label = "QDEC_0";
};

conf

# quadrature decoder
CONFIG_SENSOR=y
CONFIG_QDEC_SAM=y

from the datasheet, I dont see any difference between both revision regarding qdec:
image

I suggest to copy paste from
same70/same70q21.h
to
same70b/same70q21b.h

@tswaehn tswaehn added the bug The issue is a bug, or the PR is fixing a bug label Nov 18, 2023
@nandojve nandojve self-assigned this Nov 18, 2023
@nandojve
Copy link
Member

Hi @tswaehn ,

Please, open a PR on the hal and create a PR in Zephyr to update the hash.
Make sure you follow https://github.com/zephyrproject-rtos/hal_atmel#how-to-submit-code

@tswaehn
Copy link
Contributor Author

tswaehn commented Nov 22, 2023

@nandojve would be great if you could have an eye on the PR#35

Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@tswaehn
Copy link
Contributor Author

tswaehn commented Jan 27, 2024

Finally I created the changes in hal_atmel

And also created a PR in zephyr (west.yaml) to point to the changeset in hal_atmel

... I hope thats it, or did I miss something?

tswaehn added a commit to tswaehn/zephyr that referenced this issue Jan 30, 2024
This update fixes the qdec in SAME70b, which could not be compiled prior to
this fix, due to missing TC_CMR definitions. Moreover it fixes zephyrproject-rtos#65432.

Signed-off-by: Sven Ginka <[email protected]>
carlescufi pushed a commit that referenced this issue Jan 31, 2024
This update fixes the qdec in SAME70b, which could not be compiled prior to
this fix, due to missing TC_CMR definitions. Moreover it fixes #65432.

Signed-off-by: Sven Ginka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants