Skip to content

Conversation

@bcostm
Copy link
Contributor

@bcostm bcostm commented Feb 10, 2017

Description

This PR factorize the can_api.c files which were present in all TARGET_STM32Fx folders.

Changes:

  • A single can_api.c file is present in TARGET_STM folder. Common to all STM32 targets.
  • The specific part (mainly defines) are placed in new can_device.h files in TARGET_STM32Fx folders.

This will also update the can_filter function for all STM32 devices. It has been done previously only for F0 devices (PR #2988)

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Related PRs

#2988

Todos

  • [ ] Verify the can_filter function on other STM32 devices that F0 ones.

CC @martinjaeger @mgiaco

@bcostm bcostm force-pushed the dev_can_factorization branch from 410b13b to 3bcd827 Compare February 10, 2017 10:11
Copy link
Contributor

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

could we use
#if defined(TARGET_STM32F0)
..
#else

rather than the family list ?
Or maybe a specific property name that can be defined in can_device.h files ?
In case a new family is added, this would not require a change here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I'll put a "#else" instead of this big list.

@sg-
Copy link
Contributor

sg- commented Feb 13, 2017

If Travis doesn't merge with master you'll need to rebase this to get the fix that had to do with USB and STM folder renames.

@sg- sg- added the needs: CI label Feb 13, 2017
@bridadan
Copy link
Contributor

retest uvisor

@bcostm bcostm force-pushed the dev_can_factorization branch from 2b089e1 to d1911db Compare February 15, 2017 08:59
@bcostm
Copy link
Contributor Author

bcostm commented Feb 15, 2017

Rebased.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1597

Build failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2017

NUCLEO_F207ZG fails, all 3 toolchains:

05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_filter multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_free multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_frequency multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_init multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_irq_free multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_irq_init multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_irq_set multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_mode multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_monitor multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_rderror multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_read multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_reset multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_tderror multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol can_write multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN1_RX0_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN1_SCE_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN1_TX_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN2_RX0_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN2_SCE_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol CAN2_TX_IRQHandler multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol __asm___9_can_api_c_can_init____REV16 multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol __asm___9_can_api_c_can_init____REVSH multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Error: L6200E: Symbol __asm___9_can_api_c_can_init____RRX multiply defined (by can_api.o and can_api.o).
05:25:49         [DEBUG] Errors: Not enough information to list the image map.
05:25:49         [DEBUG] Errors: Finished: 1 information, 0 warning and 23 error messages.

@bridadan
Copy link
Contributor

Hi @bcostm, you can also view detailed results by clicking on the mbed Build Number: 1597 link in the mbed-bot's last comment.

@bcostm
Copy link
Contributor Author

bcostm commented Feb 16, 2017

I have removed the can_api.c file which was still present in the TARGET_STM32F2 folder. I think this is the root cause of this error. But I don't understand why I don't have this error myself when I build this target ? This is why I didn't see it before. I rebased again also.

@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1612

All builds and test passed!

@svogl
Copy link
Contributor

svogl commented Feb 20, 2017

Hi all,
I'd really be in favor of merging this; we've a small bugfix here for can_write: the current implementation does not handle the case when no tx mailbox is available.

I can supply a patch for this PR or issue a separate one, whatever's less work.
Best
S

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 20, 2017

I'd really be in favor of merging this; we've a small bugfix here for can_write: the current implementation does not handle the case when no tx mailbox is available.

@svogl Please send separate patch

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please fix formatting { as it was?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am confused now. I thought the correct coding style was to have the { at the end of the function name ?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it is not. There are still some leftovers in the code base, we are trying to fix those.

@bcostm bcostm force-pushed the dev_can_factorization branch from a8b6d2a to 30565cb Compare February 20, 2017 10:44
@bridadan
Copy link
Contributor

retest uvisor

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1661

All builds and test passed!

@svogl
Copy link
Contributor

svogl commented Feb 22, 2017

Cool,
@0xc0170 when will 5.4.0 be released? I'll have to wait to apply our fixes until then.

@sg- sg- merged commit a8a31da into ARMmbed:master Feb 22, 2017
@bcostm bcostm deleted the dev_can_factorization branch February 27, 2017 07:39
@Lynda96
Copy link

Lynda96 commented Mar 22, 2022

Hi
I am working on CAN bus with NUCLEO BOARD ,so I am coding with mbed studio , I am just doing a loop test (send data from CAN1TD and receive it from CAN2RD with the same board ) this is the code that I have tested
captureexter

it works with frame standard but if i change the format on Extended , it doesn't work , what should you ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants