Skip to content

MAX326xx: BLE updates, fixed sleep, open-drain LEDs #4398

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 1 commit into from Jul 31, 2017
Merged

MAX326xx: BLE updates, fixed sleep, open-drain LEDs #4398

merged 1 commit into from Jul 31, 2017

Conversation

jessexm
Copy link
Contributor

@jessexm jessexm commented May 26, 2017

Adding BLE support to MAX32630FTHR platform. BLE library updated to latest upstream API.

MAX32630FTHR gets BLE
libexactLE update for 610,620
Fixup hal_sleep and hal_deepsleep for 620
LEDn outputs now forced to open-drain

Depends on #4696

};

/*! WSF handler ID */
wsfHandlerId_t maximHandlerId;
static volatile int reset_complete;

#ifdef BLE_HCI_UART
Copy link
Member

Choose a reason for hiding this comment

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

How does this work with the internal HCI driver ?
Is it possible to map the driver to other pins ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently there are two Maxim HCI drivers; one for SPI and the other UART. These are separate files and do not require the use of ifdef's. Until something changes the HCI driver initialization is the common point within MaximBLE.cpp and thus needs to know what type of mbed objects are needed to reserve peripherals for HCI use.

The HCI drivers use HAL pin mapping to determine the peripheral instance associated with the given SPI slave select or UART transmit pin. With the peripheral instance the other peripheral pins can be determined programmatically. The other pin arguments represent a single pin that can be used without issue. So yes the pins can be mapped to other pins with the same functionality, although this has not been tested.

@@ -144,6 +144,10 @@ typedef enum {
OWM = P4_0,

// BTLE Module hardwired
BT_TX = P0_0,
Copy link
Member

Choose a reason for hiding this comment

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

Could you fix the indentation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@AnotherButler
Copy link
Contributor

@jessexm Thanks for the PR.

Also, we recommend our contributors follow Chris Beam’s seven rules of great commit messages to keep the commit history clear. We find the commit.template feature particularly helpful.

To match this format, please change your subject line to the imperative mood. We suggest changing it to:
Update BLE, fix sleep and open-drain LEDs in MAX326xx

Thanks for your contributions.

@jessexm
Copy link
Contributor Author

jessexm commented Jun 8, 2017

Thanks for the feedback.

Commit message updated and tabs removed.

@pan-
Copy link
Member

pan- commented Jun 13, 2017

@jessexm There is an issue with the HCIDrive on MAX32630FTHR. It use the function TMR_Delay which rely on TMR_T0, unfortunately the us_ticker use the same timer instance. It creates conflict when both are used together.

@jessexm
Copy link
Contributor Author

jessexm commented Jun 14, 2017

Nice catch of dual timer usage. MAX32630FTHR HCI updated to use timer peripheral 5.

@sg-
Copy link
Contributor

sg- commented Jun 14, 2017

/morph test

@mbed-bot
Copy link

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 553

All builds and test passed!

@pan-
Copy link
Member

pan- commented Jun 15, 2017

@0xc0170 I'm still running internal tests on this PR so I've removed the ready for merge tag.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 19, 2017

@pan- Update?

@pan-
Copy link
Member

pan- commented Jun 19, 2017

There is several issues with the serial driver (one of the reason it is not used by the CC2564 BLE driver). Those can be easily solved but I need an answer to that question: #4574 .

@theotherjimmy
Copy link
Contributor

@jessexm Could you address @pan-'s comment?

@jessexm
Copy link
Contributor Author

jessexm commented Jun 27, 2017

I have commented on #4574 and agree that a more detailed specification is a good thing and will help avoid differences in HAL implementations.

@theotherjimmy
Copy link
Contributor

@pan- any news on those internal tests?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2017

retest uvisor

@pan-
Copy link
Member

pan- commented Jul 3, 2017

@jessexm UART clarification and fix can be done outside this PR, I will open ticket to track those.
However there is a bug in the port which prevent correct use of BLE in mbed OS 5 (not 2):

The Wicentric stack shall signal BLE API when an event is available for processing. It is done in the Beetle port of BLE API:

  • During the initialization, a callback is registered in the stack (here). This callback shall be invoked by the stack at the end of the function WsfSetEvent and WsfTaskSetReady.
  • Event notification from the stack shall be forwarded to BLE_API (here).
  • Processing of event is conditional of events availability (see)

@pan-
Copy link
Member

pan- commented Jul 3, 2017

I've created a PR which solves some issues of the UART driver (#4696), there might be more.

@theotherjimmy
Copy link
Contributor

retest uvisor

@theotherjimmy
Copy link
Contributor

This cannot be merged without #4696. We will wait for that to come it first.

MAX32630FTHR gets BLE, uses timer peripheral 5 for HCI timing
libexactLE update for 610,620
Fixup hal_sleep and hal_deepsleep for 620
LEDn outputs now forced to open-drain
@jessexm
Copy link
Contributor Author

jessexm commented Jul 14, 2017

Per @pan-'s guidance the Wicentric stack has been updated to signal BLE API when an event is available.

@theotherjimmy theotherjimmy changed the title [MAX326xx] BLE updates, fixed sleep, open-drain LEDs MAX326xx: BLE updates, fixed sleep, open-drain LEDs Jul 17, 2017
@theotherjimmy
Copy link
Contributor

Preceding PR merged.

@theotherjimmy
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

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

/morph test

Output

mbed Build Number: 880

Build failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 26, 2017

/morph test

@mbed-bot
Copy link

Result: FAILURE

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

/morph test

Output

mbed Build Number: 890

Example Build failed!

@theotherjimmy
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: 905

All builds and test passed!

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