{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2253","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2253/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2253/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2253/events","html_url":"https://github.com/ARMmbed/mbed-os/pull/2253","id":167632300,"number":2253,"title":"[STM]Add RNG (random number generator) for STM32F4 STM32F7 families","user":{"login":"adustm","id":14051363,"avatar_url":"https://avatars.githubusercontent.com/u/14051363?v=3","gravatar_id":"","url":"https://api.github.com/users/adustm","html_url":"https://github.com/adustm","followers_url":"https://api.github.com/users/adustm/followers","following_url":"https://api.github.com/users/adustm/following{/other_user}","gists_url":"https://api.github.com/users/adustm/gists{/gist_id}","starred_url":"https://api.github.com/users/adustm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adustm/subscriptions","organizations_url":"https://api.github.com/users/adustm/orgs","repos_url":"https://api.github.com/users/adustm/repos","events_url":"https://api.github.com/users/adustm/events{/privacy}","received_events_url":"https://api.github.com/users/adustm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20backport%20to%20release%20branch","name":"needs: backport to release branch","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-07-26T15:10:48Z","updated_at":"2016-08-25T15:42:23Z","closed_at":"2016-08-25T14:09:48Z","pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2253","html_url":"https://github.com/ARMmbed/mbed-os/pull/2253","diff_url":"https://github.com/ARMmbed/mbed-os/pull/2253.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/2253.patch"},"body":"These functions are to be tested in mbed-os environment.\r\n\r\nThe test was passed for DISCO_F429ZI and NUCLEO_F746ZG with IAR toolchain.\r\nThe compilation passes for DISCO_F429ZI / DISCO_F469NI / DISCO_F746NG / NUCLEO_F410RB / NUCLEO_F429ZI / NUCLEO_F746ZG / NUCLEO_F767ZI\r\n\r\n**Please note that not every STM32F4 platforms are supporting the RNG feature. Some defines have been added in hal/targets/hal/TARGET_STM/TARGET_STM32F4/entropy_hardware_poll.c to enable the relevant targets.**\r\nI did not find any code to test the function, thus I used the one below : \r\n```\r\n#include \"test_env.h\"\r\n#include \"entropy_poll.h\"\r\n\r\n#define BUFF_SIZE       500\r\nunsigned char myrndbuff[BUFF_SIZE]={0};\r\nsize_t *olen;\r\n\r\nint main() {\r\n\tint ret = 0;\r\n\tint result = false;\r\n\tsize_t mysize=0;\r\n\tolen = &mysize;\r\n    ret = mbedtls_hardware_poll( NULL, myrndbuff, BUFF_SIZE, olen );\r\n    if (ret == 0 ) {\r\n    \tprintf(\"tls_ret_ok\\n\");\r\n    \tprintf(\"%i\\n\",(int)*olen);\r\n\t\tif (*olen == BUFF_SIZE) {\r\n\t\t\tprintf(\"size ok\\n\");\r\n\t\t\tresult = true;\r\n\t\t} else printf(\"size ko\\n\");\r\n    } else printf(\"tls_ret_ko\\n\");\r\n}\r\n\r\n```\r\nThis result was the following : \r\n```\r\ntls_ret_ok\r\n500\r\nsize ok\r\n```\r\nAnother printf inside the code showed that the values seemed to be random (I trust the hardware :) )"},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/242434690","html_url":"https://github.com/ARMmbed/mbed-os/pull/2253#issuecomment-242434690","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2253","id":242434690,"user":{"login":"bridadan","id":3123977,"avatar_url":"https://avatars.githubusercontent.com/u/3123977?v=3","gravatar_id":"","url":"https://api.github.com/users/bridadan","html_url":"https://github.com/bridadan","followers_url":"https://api.github.com/users/bridadan/followers","following_url":"https://api.github.com/users/bridadan/following{/other_user}","gists_url":"https://api.github.com/users/bridadan/gists{/gist_id}","starred_url":"https://api.github.com/users/bridadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridadan/subscriptions","organizations_url":"https://api.github.com/users/bridadan/orgs","repos_url":"https://api.github.com/users/bridadan/repos","events_url":"https://api.github.com/users/bridadan/events{/privacy}","received_events_url":"https://api.github.com/users/bridadan/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T15:42:23Z","updated_at":"2016-08-25T15:42:23Z","body":"Hi everyone, sorry for the delay on reporting back on this.\r\n\r\nFor build 710 (that last one), a test box died again which cause the whole thing to fail. I've since reorganized the boards so they are more balanced across the boxes, so that should help with stability.\r\n\r\nI can confirm that build 685 looks ok, so the merge to master should be fine :+1: "}}
{"actor":{"display_login":"bridadan"}}