Skip to content

[platforms] new platform Qorvo GP712. - #1942

Merged
jwhui merged 15 commits into
openthread:masterfrom
erja-gp:master
Jul 11, 2017
Merged

[platforms] new platform Qorvo GP712.#1942
jwhui merged 15 commits into
openthread:masterfrom
erja-gp:master

Conversation

@erja-gp

@erja-gp erja-gp commented Jun 28, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@erja-gp

erja-gp commented Jun 28, 2017

Copy link
Copy Markdown
Contributor Author

CLA -> I signed it!

@jwhui jwhui changed the title new platform Qorvo GP712. [platforms] new platform Qorvo GP712. Jun 28, 2017
Comment thread examples/Makefile-gp712 Outdated
@@ -0,0 +1,274 @@
#
# Copyright (c) 2016-2017, The OpenThread Authors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: should be 2017

Comment thread examples/platforms/gp712/Makefile.am Outdated
-I$(top_srcdir)/examples/platforms \
-I$(top_srcdir)/examples/platforms/utils\
-I$(top_srcdir)/src/core \
-lrt \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: align \

Comment thread examples/platforms/gp712/flash.c Outdated
#include "utils/flash.h"

static int sFlashFd;
uint32_t sEraseAddress;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: align variable names

Comment thread examples/platforms/gp712/flash.c Outdated
{
FLASH_SIZE = 0x40000,
FLASH_PAGE_SIZE = 0x800,
FLASH_PAGE_NUM = 128,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These look like they should maybe be #defines rather then enums. If this is going to be an enum, then the names should start with a k and be CamelCase rather then all caps snake_case

Comment thread examples/platforms/gp712/flash.c Outdated
otError utilsFlashInit(void)
{
otError error = OT_ERROR_NONE;
char fileName[20];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: align variable names

Comment thread examples/platforms/gp712/uart-socket.c Outdated
uint8_t readChar;
//Remove trigger byte from pipe
res = read(PlatSocketPipeFd [0], &readChar, 1);
(void)(res);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why assign to res if its not going to be used?

Comment thread examples/platforms/gp712/uart-socket.c Outdated
PlatSocketRx(readLen, buffer, clientSocket->socketId);

res = write(PlatSocketPipeFd [1], &someByte, 1); //[1] = write fd
(void)(res);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why have res if your just going to assign to it and then ignore the value?


PlatSocketClose(clientSocket->socketId);

return NULL;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this return something other then NULL?

Comment thread examples/platforms/gp712/uart-socket.c Outdated
void PlatSocketRxNewConn(uint8_t id)
{
//Find first non-valid client in list - add here
if (PlatSocketConnection.isValid == 0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: indentation is off

Comment thread examples/platforms/gp712/uart-socket.c Outdated
//All sockets
if(PlatSocketConnection.isValid)
{
if((int)PlatSocketConnection.socketId == (int)socketId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both sides of this conditional are originally uint32_t, so why are they both being cast to int before comparison?

@erja-gp

erja-gp commented Jun 29, 2017

Copy link
Copy Markdown
Contributor Author

@aeliot : these commits should cover all of the comments you made. Some of the code was very close to the posix code, and by e.g. removing the checks for WIN the difference becomes a bit bigger, but I guess that's not really an issue.


void cbQorvoRadioTransmitDone(otRadioFrame *aPacket, bool aFramePending, otError aError)
{
otPlatRadioTransmitDone(pQorvoInstance, aPacket, aFramePending, aError);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is not recommended to use the legacy TransmitDone() callback anymore, could you use the new TxDone() instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I understand the remark, but this is not a trivial change and we do not plan to do that immediately.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree that it is not mandatory for now, the short-term benefit is that ACK messages could also be used for link quality evaluation. But eventually, we need to use the new TxDone() callback for some new features.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually have the same problem with another platform I'm working on. It seams like we may need to come up with a way for these two to coexist going forwards.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

Comment thread examples/Makefile-gp712 Outdated
#
define build-arch
$(ECHO) " BUILD $(1)-$(TargetTuple)"
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(1)-$(TargetTuple) -w \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The other examples Makefiles have $(BuildPath)/$(TargetTuple). Was having $(BuildPath)/$(1)-$(TargetTuple) a conscious decision?

Comment thread examples/Makefile-gp712 Outdated
#
define stage-arch
$(ECHO) " STAGE $(1)-$(TargetTuple)"
$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(1)-$(TargetTuple) -w \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See comment above.

Comment thread examples/Makefile-gp712 Outdated
CONFIGURE_TARGETS += configure-$(1)
BUILD_TARGETS += do-build-$(1)
STAGE_TARGETS += stage-$(1)
BUILD_DIRS += $(BuildPath)/$(1)-$(TargetTuple)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See comment above.

Comment thread examples/platforms/gp712/uart-posix.c Outdated
return error;
}

void platformUartUpdateFdSet(fd_set *aReadFdSet, fd_set *aWriteFdSet, fd_set *aErrorFdSet, int *aMaxFd)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just remove this function?

@jwhui

jwhui commented Jul 7, 2017

Copy link
Copy Markdown
Member

Also, please add a third_party/Qorvo/README.md file that provides version and license information for the contents. You can find an example with third_party/mbedtls/README.md.

Comment thread examples/platforms/gp712/flash.c Outdated

// Write the page
r = pwrite(sFlashFd, &(dummyPage[0]), FLASH_PAGE_SIZE, (off_t)address);
otEXPECT_ACTION(((int)r) == ((int)(FLASH_PAGE_SIZE)), error = OT_ERROR_FAILED);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are both sides of this conditional cast to int? I think you can do the comparison without the cast.

Comment thread examples/platforms/gp712/platform.c Outdated
{
if (localInstance)
{
return !otTaskletsArePending(localInstance);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There should only be one return statement, as per the style guide.

{
uint16_t panid;
} otCachedSettings_t;
static otCachedSettings_t otCachedSettings;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: newline between type definition and usage.

Comment thread examples/platforms/gp712/radio.c Outdated
static uint8_t sScanstate = 0;
static int8_t sLastReceivedPower = 127;


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: extra newline

Comment thread examples/platforms/gp712/uart-posix.c Outdated
otEXPECT_ACTION(tcsetattr(s_out_fd, TCSANOW, &termios) == 0, perror("tcsetattr"); error = OT_ERROR_GENERIC);
}

return error;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should only be one return statement.

Comment thread examples/platforms/gp712/uart-socket.c Outdated

// hack
res = pipe(PlatSocketPipeFd);
(void)(res);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why assign to res if its going to be ignored?

@jwhui
jwhui requested a review from aeliot July 10, 2017 15:43
Comment thread examples/platforms/gp712/radio.c Outdated

enum
{
IEEE802154_MIN_LENGTH = 5,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Align =

Comment thread examples/platforms/gp712/uart-socket.c Outdated
{
buf = malloc(length + 2);
memcpy(buf, buffer, length);
buf[length] = '\n';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: align =

@jwhui
jwhui requested a review from aeliot July 10, 2017 19:00

@aeliot aeliot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, except my comments in uart-socket.c about unused variables.

@erja-gp

erja-gp commented Jul 11, 2017

Copy link
Copy Markdown
Contributor Author

@aeliot Indeed I missed out two more unused variables -> fixed it.

@jwhui
jwhui merged commit 3078359 into openthread:master Jul 11, 2017
@beriberikix

Copy link
Copy Markdown
Contributor

🎉 congrats! 🎉 Feel free to add Qorvo the AUTHORS file.

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.

6 participants