{"action":"created","issue":{"url":"https://api.github.com/repos/PX4/Firmware/issues/2646","labels_url":"https://api.github.com/repos/PX4/Firmware/issues/2646/labels{/name}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/2646/comments","events_url":"https://api.github.com/repos/PX4/Firmware/issues/2646/events","html_url":"https://github.com/PX4/Firmware/pull/2646","id":99311861,"number":2646,"title":"Beta pio memory","user":{"login":"davids5","id":1945821,"avatar_url":"https://avatars.githubusercontent.com/u/1945821?v=3","gravatar_id":"","url":"https://api.github.com/users/davids5","html_url":"https://github.com/davids5","followers_url":"https://api.github.com/users/davids5/followers","following_url":"https://api.github.com/users/davids5/following{/other_user}","gists_url":"https://api.github.com/users/davids5/gists{/gist_id}","starred_url":"https://api.github.com/users/davids5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davids5/subscriptions","organizations_url":"https://api.github.com/users/davids5/orgs","repos_url":"https://api.github.com/users/davids5/repos","events_url":"https://api.github.com/users/davids5/events{/privacy}","received_events_url":"https://api.github.com/users/davids5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-05T22:21:50Z","updated_at":"2015-08-05T23:49:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PX4/Firmware/pulls/2646","html_url":"https://github.com/PX4/Firmware/pull/2646","diff_url":"https://github.com/PX4/Firmware/pull/2646.diff","patch_url":"https://github.com/PX4/Firmware/pull/2646.patch"},"body":"This regains a bunch of memory.\r\n\r\nFirst note that make oldconfig has been run and the defconfig has been updated.\r\n\r\nThe FW is now using the interrupt stack. This allows the reduction for both idle and the main task's stack\r\n\r\nCONFIG_ARCH_INTERRUPTSTACK = 500 40 Bytes margin\r\nCONFIG_IDLETHREAD_STACKSIZE= 290 - usage is ~136 bytes with a 154 byte margin\r\nCONFIG_USERMAIN_STACKSIZE=800 with a 268 bytes margin \r\n\r\n# Last build of Beta:\r\n```\r\n px4io status\r\npx4io: loaded\r\nprotocol 4 hardware 2 bootloader 3 buffer 64B crc 0x69b3b47b\r\n8 controls 8 actuators 18 R/C inputs 2 analog inputs 0 relays\r\n376 bytes free\r\nstatus 0x2741 OUTPUTS_ARMED SAFETY_SAFE RC_FAIL FMU_OK MIXER_OK ARM_SYNC INIT_OK\r\nalarms 0x0030 FMU_LOST RC_LOST\r\nvservo 65 mV vservo scale 10000\r\n```\r\n\r\n# This build\r\n```\r\nnsh> px4io status\r\npx4io: loaded\r\nprotocol 4 hardware 2 bootloader 3 buffer 64B crc 0xa931098c\r\n8 controls 8 actuators 18 R/C inputs 2 analog inputs 0 relays\r\n1496 bytes free\r\nstatus 0x2741 OUTPUTS_ARMED SAFETY_SAFE RC_FAIL FMU_OK MIXER_OK ARM_SYNC INIT_OK\r\nalarms 0x0030 FMU_LOST RC_LOST\r\nvservo 62 mV vservo scale 10000\r\nvrssi 863\r\nactuators 0 0 0 0 0 0 0 0\r\nservos 0 0 0 0 0 0 0 0\r\nreversed outputs: [________] trims: r:   0.0000 p:   0.0000 y:   0.0000\r\n0 raw R/C inputs\r\nR/C flags: 0x0000\r\nmapped R/C inputs 0x0000\r\nADC inputs 27 1768\r\nfeatures 0x0008 RSSI_ADC\r\narming 0x0030 FMU_DISARMED IO_ARM_DENIED INAIR_RESTART_OK ALWAYS_PWM_ENABLE\r\nrates 0x000f default 50 alt 400\r\ndebuglevel 0\r\ncontrols 0: 498 -691 497 0 0 0 0 0\r\ncontrols 1: 0 0 0 0 0 0 0 0\r\ncontrols 2: 0 0 0 0 0 0 0 0\r\ncontrols 3: 0 0 0 0 0 0 0 0\r\ninput 0 min 1000 center 1500 max 2000 deadzone 10 assigned 0 options 0x0001 ENABLED\r\ninput 1 min 1000 center 1500 max 2000 deadzone 10 assigned 1 options 0x0001 ENABLED\r\ninput 2 min 1000 center 1500 max 2000 deadzone 10 assigned 3 options 0x0001 ENABLED\r\ninput 3 min 1000 center 1500 max 2000 deadzone 10 assigned 2 options 0x0001 ENABLED\r\ninput 4 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000\r\ninput 5 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000\r\ninput 6 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000\r\ninput 7 min 1000 center 1500 max 2000 deadzone 10 assigned 255 options 0x0000\r\ninput 8 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 9 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 10 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 11 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 12 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 13 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 14 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 15 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 16 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\ninput 17 min 1000 center 1500 max 2000 deadzone 0 assigned 255 options 0x0000\r\nfailsafe 0 0 0 0 0 0 0 0\r\ndisarmed values 900 900 900 900 0 0 0 0\r\n```"},"comment":{"url":"https://api.github.com/repos/PX4/Firmware/issues/comments/128185646","html_url":"https://github.com/PX4/Firmware/pull/2646#issuecomment-128185646","issue_url":"https://api.github.com/repos/PX4/Firmware/issues/2646","id":128185646,"user":{"login":"davids5","id":1945821,"avatar_url":"https://avatars.githubusercontent.com/u/1945821?v=3","gravatar_id":"","url":"https://api.github.com/users/davids5","html_url":"https://github.com/davids5","followers_url":"https://api.github.com/users/davids5/followers","following_url":"https://api.github.com/users/davids5/following{/other_user}","gists_url":"https://api.github.com/users/davids5/gists{/gist_id}","starred_url":"https://api.github.com/users/davids5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davids5/subscriptions","organizations_url":"https://api.github.com/users/davids5/orgs","repos_url":"https://api.github.com/users/davids5/repos","events_url":"https://api.github.com/users/davids5/events{/privacy}","received_events_url":"https://api.github.com/users/davids5/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T23:49:52Z","updated_at":"2015-08-05T23:49:52Z","body":"@LorenzMeier \r\n\r\nIn debugging this I have seen text_length = 178 Which implies a length of 181 as an input to the routine. That explains why it fails at 180 and the free memory is so much larger. This may be the case with 220 for a size as well. The 36 byte difference (256->220) Still results in a increase of 496 bytes (968 -> 1464)  of free memory\r\n\r\n\r\n"}}